-
Notifications
You must be signed in to change notification settings - Fork 390
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
invalid format string conversion in src/common.c #3026
Comments
Does icc not like the %m format? |
It's not ISO C: https://stackoverflow.com/a/20577576/2189128. The fix is easy enough. Just apply the definition found on http://www.gnu.org/software/libc/manual/html_node/Other-Output-Conversions.html:
|
And indeed, ICC will not compile this with |
With sscanf, the %m allocates a buffer of an appropriate size. I can switch to using a fixed-size buffer, with checks to see that it doesn't get overrun (I think). |
The code relies on a gcc extension to sscanf (%m) that isn't available on other compilers (i.e. icc, even when gcc compliance is enabled). Replace %m will fixed sized buffers and check for overrun. Fixes ofiwg#3026 Signed-off-by: Sean Hefty <[email protected]>
The code relies on a gcc extension to sscanf (%m) that isn't available on other compilers (i.e. icc, even when gcc compliance is enabled). Replace %m will fixed sized buffers and check for overrun. Fixes ofiwg#3026 Signed-off-by: Sean Hefty <[email protected]>
I dislike compiler warnings...
Compiler Version
The text was updated successfully, but these errors were encountered: