-
Notifications
You must be signed in to change notification settings - Fork 64
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
ATA_LOG_PAGE_LEN_BYTES defined using UINT16_C, then later used as UINT16_C(ATA_LOG_PAGE_LEN_BYTES) #167
Comments
UINT16_C() should only be used on numeric values, not on already defined values. This causes a bug in other systems where this macro appends something to the end of the numeric value upon expansion. This issue was reported from a user with smartos [Seagate/openSeaChest#167] Signed-off-by: Tyler Erickson <[email protected]>
[#167, #168] Signed-off-by: Tyler Erickson <[email protected]>
I know we have had another Illumos distro user report some differences from their GCC compiler in the past that did not show up on Linux or FreeBSD machines I have access to. |
Digging around in the system headers, the definition is:
and there's a Sun comment about the CSTYLED thing being a flag for an internal code style auditing tool. That would seem to explain its uniqueness. Thanks for your fast responses! |
No problem. These are all pretty straight forward things to correct. I'm exploring other tools we can use to help identify these kinds of mistakes to prevent this in the future. CI would be best but I'm currently playing with clang-tidy to help find issues as well...IDK if it would have prevented these issues, but I'll add whatever I can to help prevent this from being an issue in the future. |
Jonathan Perkin from the SmartOS team, who wrangles pkgsrc, said: there are vmactions images for omnios, so folks can use github actions to kick off builds, though it's a little involved I set up an entirely github actions driven CI thing for pkgsrc that tested on a bunch of different platforms with not a lot of work, only problem is it burns through the free tier pretty quick but e.g. https://github.com/pkgsrc-ci/pkgsrc/actions/runs/10058351362 tests a commit across a whole bunch of OS (including cygwin ;) |
Er. Put this in the wrong ticket, because I kin reed, I sware... |
I will take a look at it! Thank you for asking that and sharing the link! |
Line 1912 of
subprojects/opensea-operations/src/drive_info.c
uses the constructUINT16_C(ATA_LOG_PAGE_LEN_BYTES)
, but the definition of that constant in ata_helper.h is#define ATA_LOG_PAGE_LEN_BYTES UINT16_C(512)
. At least on my SmartOS (Illumos distro) system with gcc 10.4, that results in the 'u' suffix getting appended to the value twice, and the following error:Simply removing the UINT16_C wrapper gets rid of the compile error.
Compiler:
The text was updated successfully, but these errors were encountered: