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
Clang prints garbage in compile warning #23886
Comments
Can you please provide a minimal repro? |
1 similar comment
Can you please provide a minimal repro? |
commit 5cfb29320af7efe68fe6aa83e89cc3650167c5f0
CC=/usr/local/bin/clang35
Should reproduce. |
"Minimal" in this context means a preprocessed .c or .cpp file, without any external dependencies. Also, the exact command line flags used to invoke clang are almost always needed. |
Command line: /usr/local/bin/clang35 -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -mno-aes -mno-avx -std=iso9899:1999 -c if_spppsubr.c See attached if_spppsubr.c Thank you! --HPS |
Right, this is a bug in the FreeBSD-specific -fformat-extensions support, added in the lang/clang35 port. This flag isn't supported by upstream clang, and has been replaced by the format(freebsd_kprintf, x, y) attribute in trunk. For reference, a minimal example is: void foo(int, const char *, ...) attribute((format(printf, 2, 3))); void bar(const unsigned char *p, unsigned short len) Let's move this bug over to the FreeBSD bug tracker: |
Extended Description
Hi,
Clang prints garbage in one of its warnings:
/usr/img/freebsd/sys/modules/sppp/../../net/if_spppsubr.c:5372:15: warning: format specifies type 'unsigned char *' but the argument has
���������������`������������0������P����������
--HPS
The text was updated successfully, but these errors were encountered: