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

Suggested diff for src/inject.cc, for type consistency #96

Open
schongallam opened this issue Sep 10, 2024 · 0 comments
Open

Suggested diff for src/inject.cc, for type consistency #96

schongallam opened this issue Sep 10, 2024 · 0 comments

Comments

@schongallam
Copy link

Minor issue here, but src/inject.cc will not compile with clang++ due to the following error:

/usr/bin/clang++ -DHAVE_CONFIG_H -I. -I..  -I../lib   -fsanitize=address -fno-omit-frame-pointer -fno-rtti -fno-exceptions -W -Wall -MT inject.o -MD -MP -MF .deps/inject.Tpo -c -o inject.o inject.cc
inject.cc:211:3: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned int' in initializer list [-Wc++11-narrowing]
  211 |   X(Sender,            T,F,F,F,F), // 0
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Two workarounds are:

  1. compile with -Wno-c++11-narrowing
  2. compile with -std=c++03

The following diff would avoid these workarounds, and, I propose, would be a preferable general practice for type consistency:

@@ -150,7 +150,7 @@
 {
   // member information
   const char* name;
-  unsigned length;
+  size_t length;
   bool is_address;
   bool is_recipient;
   bool is_sender;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant