Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor field in MoneroGetAddress causes compilation error on FreeBSD #4460

Open
tobtoht opened this issue Dec 29, 2024 · 1 comment
Open

minor field in MoneroGetAddress causes compilation error on FreeBSD #4460

tobtoht opened this issue Dec 29, 2024 · 1 comment
Labels
code Code improvements

Comments

@tobtoht
Copy link

tobtoht commented Dec 29, 2024

The minor field in MoneroGetAddress in messages-monero.proto generates the following declaration in messages-monero.pb.h:

::uint32_t minor() const;

Which conflicts with this definition in FreeBSD system headers, resulting in this compilation error:

src/device_trezor/trezor/messages/messages-monero.pb.h:6265:14: error: expected member name or ';' after declaration specifiers
  ::uint32_t minor() const;
  ~~~~~~~~~~ ^
/monero/contrib/depends/x86_64-unknown-freebsd/native/usr/include/sys/types.h:373:20: note: expanded from macro 'minor'
#define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
                          ^

We can hack around it, but a proper fix would be to rename the fields (and to change any code that references these field names):

diff --git a/protob/messages-monero.proto b/protob/messages-monero.proto
index c88218d..c14fc2a 100644
--- a/protob/messages-monero.proto
+++ b/protob/messages-monero.proto
@@ -87,8 +87,8 @@ message MoneroGetAddress {
     repeated uint32 address_n = 1;          // BIP-32 path to derive the key from master node
     optional bool show_display = 2;         // Optionally show on display before sending the result
     optional MoneroNetworkType network_type = 3 [default=MAINNET]; // Network type
-    optional uint32 account = 4;            // Major subaddr index
-    optional uint32 minor = 5;              // Minor subaddr index
+    optional uint32 sub_addr_major = 4;     // Major subaddr index
+    optional uint32 sub_addr_minor = 5;     // Minor subaddr index
     optional bytes payment_id = 6;          // Payment ID for integrated address
 }
 
@prusnak
Copy link
Member

prusnak commented Dec 29, 2024

Since this only affects Monero and the Monero team knows about the issue (the report comes from them), I think it makes sense to do the rename as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code improvements
Projects
Status: No status
Development

No branches or pull requests

2 participants