On Sun, Nov 12 2017, Scott Cheloha <[email protected]> wrote: > Hi, > > GNU ld has prefixed the contents of .gnu.warning.SYMBOL sections > with "warning: " since 2003, so the messages themselves need not > contain the prefix anymore. > > If LLVM ld ever acknowledges .gnu.warning sections I imagine it > would emulate this behavior.
It would be good if lld gained support for .gnu.warning sections, those warnings put the light on code that should be improved; not only in the ports tree, as shown by the libcrypto warnings in base. After a quick glance it seems that recent binutils versions have the same behavior, so it's reasonable to assume that lld would follow GNU ld(1) by prepending "warning:". Especially if they don't want to get the same bug report as the gcc folks got: https://sourceware.org/ml/binutils/2003-08/msg00008.html > Thoughts? The double "warning: " message looks just weird, removing it makes sense IMO. ok jca@ > -- > Scott Cheloha > > Index: lib/libc/arch/i386/string/strcat.S > =================================================================== > RCS file: /cvs/src/lib/libc/arch/i386/string/strcat.S,v > retrieving revision 1.9 > diff -u -p -r1.9 strcat.S > --- lib/libc/arch/i386/string/strcat.S 31 Aug 2015 02:53:56 -0000 > 1.9 > +++ lib/libc/arch/i386/string/strcat.S 12 Nov 2017 04:21:37 -0000 > @@ -9,7 +9,7 @@ > #if defined(APIWARN) > #APP > .section .gnu.warning.strcat > - .ascii "warning: strcat() is almost always misused, please use > strlcat()" > + .ascii "strcat() is almost always misused, please use strlcat()" > #NO_APP > #endif > > Index: lib/libc/arch/i386/string/strcpy.S > =================================================================== > RCS file: /cvs/src/lib/libc/arch/i386/string/strcpy.S,v > retrieving revision 1.9 > diff -u -p -r1.9 strcpy.S > --- lib/libc/arch/i386/string/strcpy.S 31 Aug 2015 02:53:56 -0000 > 1.9 > +++ lib/libc/arch/i386/string/strcpy.S 12 Nov 2017 04:21:37 -0000 > @@ -9,7 +9,7 @@ > #if defined(APIWARN) > #APP > .section .gnu.warning.strcpy > - .ascii "warning: strcpy() is almost always misused, please use > strlcpy()" > + .ascii "strcpy() is almost always misused, please use strlcpy()" > #NO_APP > #endif > > Index: lib/libc/compat-43/getwd.c > =================================================================== > RCS file: /cvs/src/lib/libc/compat-43/getwd.c,v > retrieving revision 1.11 > diff -u -p -r1.11 getwd.c > --- lib/libc/compat-43/getwd.c 30 Sep 2013 12:02:30 -0000 1.11 > +++ lib/libc/compat-43/getwd.c 12 Nov 2017 04:21:37 -0000 > @@ -46,4 +46,4 @@ getwd(char *buf) > } > > __warn_references(getwd, > - "warning: getwd() possibly used unsafely; consider using getcwd()"); > + "getwd() possibly used unsafely; consider using getcwd()"); > Index: lib/libc/stdio/mktemp.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdio/mktemp.c,v > retrieving revision 1.38 > diff -u -p -r1.38 mktemp.c > --- lib/libc/stdio/mktemp.c 13 Sep 2015 08:31:47 -0000 1.38 > +++ lib/libc/stdio/mktemp.c 12 Nov 2017 04:21:37 -0000 > @@ -119,7 +119,7 @@ _mktemp(char *path) > } > > __warn_references(mktemp, > - "warning: mktemp() possibly used unsafely; consider using mkstemp()"); > + "mktemp() possibly used unsafely; consider using mkstemp()"); > > char * > mktemp(char *path) > Index: lib/libc/stdio/sprintf.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdio/sprintf.c,v > retrieving revision 1.18 > diff -u -p -r1.18 sprintf.c > --- lib/libc/stdio/sprintf.c 1 Oct 2015 02:32:07 -0000 1.18 > +++ lib/libc/stdio/sprintf.c 12 Nov 2017 04:21:37 -0000 > @@ -39,7 +39,7 @@ > > #if defined(APIWARN) > __warn_references(sprintf, > - "warning: sprintf() is often misused, please use snprintf()"); > + "sprintf() is often misused, please use snprintf()"); > #endif > > int > Index: lib/libc/stdio/tempnam.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdio/tempnam.c,v > retrieving revision 1.19 > diff -u -p -r1.19 tempnam.c > --- lib/libc/stdio/tempnam.c 31 Aug 2015 02:53:57 -0000 1.19 > +++ lib/libc/stdio/tempnam.c 12 Nov 2017 04:21:37 -0000 > @@ -37,7 +37,7 @@ > #include <unistd.h> > > __warn_references(tempnam, > - "warning: tempnam() possibly used unsafely; consider using mkstemp()"); > + "tempnam() possibly used unsafely; consider using mkstemp()"); > > char * > tempnam(const char *dir, const char *pfx) > Index: lib/libc/stdio/tmpnam.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdio/tmpnam.c,v > retrieving revision 1.11 > diff -u -p -r1.11 tmpnam.c > --- lib/libc/stdio/tmpnam.c 31 Aug 2015 02:53:57 -0000 1.11 > +++ lib/libc/stdio/tmpnam.c 12 Nov 2017 04:21:37 -0000 > @@ -37,7 +37,7 @@ > #include <unistd.h> > > __warn_references(tmpnam, > - "warning: tmpnam() possibly used unsafely; consider using mkstemp()"); > + "tmpnam() possibly used unsafely; consider using mkstemp()"); > > char * > tmpnam(char *s) > Index: lib/libc/stdio/vsprintf.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdio/vsprintf.c,v > retrieving revision 1.16 > diff -u -p -r1.16 vsprintf.c > --- lib/libc/stdio/vsprintf.c 9 Nov 2009 00:18:28 -0000 1.16 > +++ lib/libc/stdio/vsprintf.c 12 Nov 2017 04:21:37 -0000 > @@ -38,7 +38,7 @@ > > #if defined(APIWARN) > __warn_references(vsprintf, > - "warning: vsprintf() is often misused, please use vsnprintf()"); > + "vsprintf() is often misused, please use vsnprintf()"); > #endif > > int > Index: lib/libc/stdlib/rand.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdlib/rand.c,v > retrieving revision 1.17 > diff -u -p -r1.17 rand.c > --- lib/libc/stdlib/rand.c 22 Oct 2016 19:19:34 -0000 1.17 > +++ lib/libc/stdlib/rand.c 12 Nov 2017 04:21:37 -0000 > @@ -44,7 +44,7 @@ DEF_WEAK(rand_r); > > #if defined(APIWARN) > __warn_references(rand_r, > - "warning: rand_r() is not random, it is deterministic."); > + "rand_r() is not random, it is deterministic."); > #endif > > int > @@ -57,7 +57,7 @@ rand(void) > > #if defined(APIWARN) > __warn_references(rand, > - "warning: rand() may return deterministic values, is that what you > want?"); > + "rand() may return deterministic values, is that what you want?"); > #endif > > void > Index: lib/libc/stdlib/random.c > =================================================================== > RCS file: /cvs/src/lib/libc/stdlib/random.c,v > retrieving revision 1.30 > diff -u -p -r1.30 random.c > --- lib/libc/stdlib/random.c 5 Apr 2016 04:29:21 -0000 1.30 > +++ lib/libc/stdlib/random.c 12 Nov 2017 04:21:37 -0000 > @@ -415,5 +415,5 @@ random(void) > > #if defined(APIWARN) > __warn_references(random, > - "warning: random() may return deterministic values, is that what you > want?"); > + "random() may return deterministic values, is that what you want?"); > #endif > Index: lib/libc/string/stpcpy.c > =================================================================== > RCS file: /cvs/src/lib/libc/string/stpcpy.c,v > retrieving revision 1.2 > diff -u -p -r1.2 stpcpy.c > --- lib/libc/string/stpcpy.c 9 Jul 2014 17:08:21 -0000 1.2 > +++ lib/libc/string/stpcpy.c 12 Nov 2017 04:21:37 -0000 > @@ -33,7 +33,7 @@ > > #if defined(APIWARN) > __warn_references(stpcpy, > - "warning: stpcpy() is dangerous; do not use it"); > + "stpcpy() is dangerous; do not use it"); > #endif > > char * > Index: lib/libc/string/strcat.c > =================================================================== > RCS file: /cvs/src/lib/libc/string/strcat.c,v > retrieving revision 1.9 > diff -u -p -r1.9 strcat.c > --- lib/libc/string/strcat.c 10 Jun 2014 04:17:37 -0000 1.9 > +++ lib/libc/string/strcat.c 12 Nov 2017 04:21:37 -0000 > @@ -33,7 +33,7 @@ > > #if defined(APIWARN) > __warn_references(strcat, > - "warning: strcat() is almost always misused, please use strlcat()"); > + "strcat() is almost always misused, please use strlcat()"); > #endif > > char * > Index: lib/libc/string/strcpy.c > =================================================================== > RCS file: /cvs/src/lib/libc/string/strcpy.c,v > retrieving revision 1.9 > diff -u -p -r1.9 strcpy.c > --- lib/libc/string/strcpy.c 10 Jun 2014 04:17:37 -0000 1.9 > +++ lib/libc/string/strcpy.c 12 Nov 2017 04:21:37 -0000 > @@ -33,7 +33,7 @@ > > #if defined(APIWARN) > __warn_references(strcpy, > - "warning: strcpy() is almost always misused, please use strlcpy()"); > + "strcpy() is almost always misused, please use strlcpy()"); > #endif > > char * > Index: lib/libc/string/wcscat.c > =================================================================== > RCS file: /cvs/src/lib/libc/string/wcscat.c,v > retrieving revision 1.4 > diff -u -p -r1.4 wcscat.c > --- lib/libc/string/wcscat.c 12 Sep 2015 16:23:14 -0000 1.4 > +++ lib/libc/string/wcscat.c 12 Nov 2017 04:21:37 -0000 > @@ -33,7 +33,7 @@ > > #if defined(APIWARN) > __warn_references(wcscat, > - "warning: wcscat() is almost always misused, please use wcslcat()"); > + "wcscat() is almost always misused, please use wcslcat()"); > #endif > > wchar_t * > Index: lib/libc/string/wcscpy.c > =================================================================== > RCS file: /cvs/src/lib/libc/string/wcscpy.c,v > retrieving revision 1.4 > diff -u -p -r1.4 wcscpy.c > --- lib/libc/string/wcscpy.c 8 Aug 2005 08:05:37 -0000 1.4 > +++ lib/libc/string/wcscpy.c 12 Nov 2017 04:21:37 -0000 > @@ -33,7 +33,7 @@ > > #if defined(APIWARN) > __warn_references(wcscpy, > - "warning: wcscpy() is almost always misused, please use wcslcpy()"); > + "wcscpy() is almost always misused, please use wcslcpy()"); > #endif > > wchar_t * > Index: lib/libcrypto/evp/evp_enc.c > =================================================================== > RCS file: /cvs/src/lib/libcrypto/evp/evp_enc.c,v > retrieving revision 1.36 > diff -u -p -r1.36 evp_enc.c > --- lib/libcrypto/evp/evp_enc.c 29 Jan 2017 17:49:23 -0000 1.36 > +++ lib/libcrypto/evp/evp_enc.c 12 Nov 2017 04:21:37 -0000 > @@ -258,7 +258,7 @@ EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, > } > > __warn_references(EVP_CipherFinal, > - "warning: EVP_CipherFinal is often misused, please use > EVP_CipherFinal_ex and EVP_CIPHER_CTX_cleanup"); > + "EVP_CipherFinal is often misused, please use EVP_CipherFinal_ex and > EVP_CIPHER_CTX_cleanup"); > > int > EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) > @@ -368,7 +368,7 @@ EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, u > } > > __warn_references(EVP_EncryptFinal, > - "warning: EVP_EncryptFinal is often misused, please use > EVP_EncryptFinal_ex and EVP_CIPHER_CTX_cleanup"); > + "EVP_EncryptFinal is often misused, please use EVP_EncryptFinal_ex and > EVP_CIPHER_CTX_cleanup"); > > int > EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) > @@ -483,7 +483,7 @@ EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, u > } > > __warn_references(EVP_DecryptFinal, > - "warning: EVP_DecryptFinal is often misused, please use > EVP_DecryptFinal_ex and EVP_CIPHER_CTX_cleanup"); > + "EVP_DecryptFinal is often misused, please use EVP_DecryptFinal_ex and > EVP_CIPHER_CTX_cleanup"); > > int > EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) > -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
