-
Notifications
You must be signed in to change notification settings - Fork 48
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
warning: type of bit-field 'dzg_meter' is a GCC extension #69
Comments
Should be a uint8 or simply uint? |
i'm not good at c-programming, but isn't that struct simply meant so carry some flag to simply store some tiny bit of information if some workaround needs to be applied again or not? don't know what correct datatype is correct for this, i would have chosen some "bool" but not some special type which generates some compiler warning. so i think unsigned int would be ok here and makes the compile warning go away. should i send a pull request ? |
by reading this, i think you are correct and "unsigned int" is correct when using bit-field: https://www.tutorialspoint.com/cprogramming/c_bit_fields.htm so
should be
|
this can be closed after merging the pull request |
Bzw.: sollte das nicht lieber ein uint8_t sein (https://stackoverflow.com/questions/22842707/size-of-uint8-uint16-and-uint32#22843368) damit es wirklich 8-bittig bleibt? Oder ist uns das egal? |
could you also close this one @andig ? (as i see that my fix proposal has been merged) sorry, i did not see your question and i cannot answer, as my c-skills are not good enough |
src/sml_list.c:124:2: Warnung: Typ des Bitfeldes »dzg_meter« ist eine Erweiterung des GCC [-Wpedantic]
u8 dzg_meter:1;
^
src/sml_list.c:124:2: warning: type of bit-field 'dzg_meter' is a GCC extension [-Wpedantic]
u8 dzg_meter:1;
^
The text was updated successfully, but these errors were encountered: