From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 2F6871F66E for ; Sun, 23 Aug 2020 13:47:06 +0000 (UTC) Received: from localhost ([::1]:46960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9qKu-00021u-WB for normalperson@yhbt.net; Sun, 23 Aug 2020 09:47:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9qKs-00021U-7i for bug-gnulib@gnu.org; Sun, 23 Aug 2020 09:47:02 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.21]:32549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9qKo-000883-7N for bug-gnulib@gnu.org; Sun, 23 Aug 2020 09:47:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1598190415; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=XZp1MsXxFAk3+nUTrOei+XIJO7Lkw04uj3t1HGRWRqY=; b=ceQcHc8BXzcH4vZCuJ1f5y1f/b0lu2oSQEu3Zf0jBaOukUCS9R1Z/lSepQgz3c6ZA7 ZJ7b59wzxNhRYoBCU9vMcXH/0hEjWARkW8MKggJ03nxqLv0aDWfiq3PvB0ZmH+XB/Xcm vks7M384mcGrZ1GgOSnnyw0fVvwz/pSae3Npa5yCt1LvXC4zYmSwUzPtROg6xzJELi9h usoHxMNZAiiYBMCpW1BcgNs2ePCvbbUdNpZQL/GHvsFdcxLoctIrVpezCx4TlUqWs+d4 2uyttOj4n6SE6X6I1tHKZWWq7zK+imVfmkryOOvp0lFjLzqzvbft8Ad8PbdPaL7xFiBE GC5Q== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqfyyPs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id z05f0fw7NDkpF9b (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 23 Aug 2020 15:46:51 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: clang's __diagnose_if__ and glibc fortify Date: Sun, 23 Aug 2020 15:46:50 +0200 Message-ID: <7776169.abOZdhWsUJ@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <5e607e6f-ee3a-41bc-67eb-cdc0571d00d0@cs.ucla.edu> References: <5e607e6f-ee3a-41bc-67eb-cdc0571d00d0@cs.ucla.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart8751244.t73vNALQW0" Content-Transfer-Encoding: 7Bit Received-SPF: none client-ip=85.215.255.21; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/23 09:46:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Eggert Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --nextPart8751244.t73vNALQW0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Paul Eggert wrote: >+ libc-config: avoid Clang=E2=80=99s __diagnose_if__ >+ * lib/cdefs.h (__warndecl, __warnattr, __errordecl): >+ For now, do not use __diagnose_if__ here, as this fails >+ on Fedora 31 with Clang 9.0.1, with diagnostic >+ "/usr/include/bits/stdio2.h:263:9: error: fgets called with bigger >+ size than length of destination buffer >+ [-Werror,-Wuser-defined-warnings]". I guess Clang 9 warns even >+ for functions that are not called? I can reproduce the redundant warnings, on Fedora 31 with Clang 9.0.1, when applying the change to gnulib/lib/cdefs.h also to /usr/include/sys/cdefs.h. With the attached program foo.c I get warnings for each of these inline functions that conditionally invokes a *_chk_warn function. Apparently, clang - unlike GCC - processes the body of the inline function also when the inline function is never referenced. It would be possible to silence these warnings by adding a gnulib module as attached (clang-warnings.tar.gz). BUT since the macros __warndecl and __warnattr are ONLY used by Fortify inline functions - there are no other uses in the glibc headers, nor in gnu= lib - and most of these uses produce redundant warnings, this is all pointless. What matters for user code is that gnulib's "attribute.h" defines ATTRIBUTE_WARNING and ATTRIBUTE_ERROR in a way that works with clang. In order to use the clang __diagnose_if__ primitive, the Fortify inline functions would need to be written in a different way. This has been done in the Android header files. For example, here is the fgets function in glibc - tailored for GCC -: extern char *__REDIRECT (__fgets_chk_warn, (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream), __fgets_chk) __wur __warnattr ("fgets called with bigger size than length " "of destination buffer"); __fortify_function __wur char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__bos (__s) !=3D (size_t) -1) { if (!__builtin_constant_p (__n) || __n <=3D 0) return __fgets_chk (__s, __bos (__s), __n, __stream); if ((size_t) __n > __bos (__s)) return __fgets_chk_warn (__s, __bos (__s), __n, __stream); // <=3D= =3D=3D line 263 } return __fgets_alias (__s, __n, __stream); } and here it is in Android - tailored for clang -: __BIONIC_FORTIFY_INLINE char* fgets(char* const __pass_object_size dest, int size, FILE* stream) __overloadable __clang_error_if(size < 0, "in call to 'fgets', size should not be = negative") __clang_error_if(size > __bos(dest), "in call to 'fgets', size is larger than the desti= nation buffer") { size_t bos =3D __bos(dest); if (bos =3D=3D __BIONIC_FORTIFY_UNKNOWN_SIZE) { return __call_bypassing_fortify(fgets)(dest, size, stream); } return __fgets_chk(dest, size, stream, bos); } 2020-08-23 Bruno Haible libc-config: Improve comments. * lib/cdefs.h (__warndecl, __warnattr, __errordecl): Explain why we cannot use clang's __diagnose_if__ here. diff --git a/lib/cdefs.h b/lib/cdefs.h index 32a2c40..1ae9ffc 100644 =2D-- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -148,7 +148,11 @@ # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) =2D#elif __glibc_clang_has_attribute (__diagnose_if__) && 0 /* fails on Fed= ora 31 with Clang 9. */ +#elif __glibc_clang_has_attribute (__diagnose_if__) && 0 +/* These definitions are not enabled, because they produce bogus warnings + in the glibc Fortify functions. These functions are written in a style + that works with GCC. In order to work with clang, these functions would + need to be modified. */ # define __warndecl(name, msg) \ extern void name (void) __attribute__((__diagnose_if__ (1, msg, "warning= "))) # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"= ))) --nextPart8751244.t73vNALQW0 Content-Disposition: attachment; filename="foo.c" Content-Transfer-Encoding: 7Bit Content-Type: text/x-csrc; charset="UTF-8"; name="foo.c" #include #include #include #include #include #include #include #include #include #include #include int main (void) { char buf[80]; char *p = fgets (buf, 80, stdin); printf ("%s\n", p); } --nextPart8751244.t73vNALQW0 Content-Disposition: attachment; filename="foo-warnings.txt" Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; name="foo-warnings.txt" In file included from foo.c:3: In file included from /usr/include/poll.h:1: In file included from /usr/include/sys/poll.h:73: /usr/include/bits/poll2.h:43:9: warning: poll called with fds buffer too small file nfds entries [-Wuser-defined-warnings] return __poll_chk_warn (__fds, __nfds, __timeout, __bos (__fds)); ^ /usr/include/bits/poll2.h:33:3: note: from 'diagnose_if' attribute on '__poll_chk_warn': __warnattr ("poll called with fds buffer too small file nfds entries"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:4: In file included from /usr/include/sys/socket.h:269: /usr/include/bits/socket2.h:42:9: warning: recv called with bigger length than size of destination buffer [-Wuser-defined-warnings] return __recv_chk_warn (__fd, __buf, __n, __bos0 (__buf), __flags); ^ /usr/include/bits/socket2.h:30:6: note: from 'diagnose_if' attribute on '__recv_chk_warn': __warnattr ("recv called with bigger length than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:4: In file included from /usr/include/sys/socket.h:269: /usr/include/bits/socket2.h:73:9: warning: recvfrom called with bigger length than size of destination buffer [-Wuser-defined-warnings] return __recvfrom_chk_warn (__fd, __buf, __n, __bos0 (__buf), __flags, ^ /usr/include/bits/socket2.h:60:6: note: from 'diagnose_if' attribute on '__recvfrom_chk_warn': __warnattr ("recvfrom called with bigger length than size of " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:5: In file included from /usr/include/stdio.h:867: /usr/include/bits/stdio2.h:263:9: warning: fgets called with bigger size than length of destination buffer [-Wuser-defined-warnings] return __fgets_chk_warn (__s, __bos (__s), __n, __stream); ^ /usr/include/bits/stdio2.h:251:12: note: from 'diagnose_if' attribute on '__fgets_chk_warn': __wur __warnattr ("fgets called with bigger size than length " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:5: In file included from /usr/include/stdio.h:867: /usr/include/bits/stdio2.h:295:9: warning: fread called with bigger size * nmemb than length of destination buffer [-Wuser-defined-warnings] return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream); ^ /usr/include/bits/stdio2.h:280:12: note: from 'diagnose_if' attribute on '__fread_chk_warn': __wur __warnattr ("fread called with bigger size * nmemb than length " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:5: In file included from /usr/include/stdio.h:867: /usr/include/bits/stdio2.h:357:9: warning: fread_unlocked called with bigger size * nmemb than length of destination buffer [-Wuser-defined-warnings] return __fread_unlocked_chk_warn (__ptr, __bos0 (__ptr), __size, __n, ^ /usr/include/bits/stdio2.h:341:12: note: from 'diagnose_if' attribute on '__fread_unlocked_chk_warn': __wur __warnattr ("fread_unlocked called with bigger size * nmemb than " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:6: In file included from /usr/include/stdlib.h:1017: /usr/include/bits/stdlib.h:71:9: warning: ptsname_r called with buflen bigger than size of buf [-Wuser-defined-warnings] return __ptsname_r_chk_warn (__fd, __buf, __buflen, __bos (__buf)); ^ /usr/include/bits/stdlib.h:60:22: note: from 'diagnose_if' attribute on '__ptsname_r_chk_warn': __nonnull ((2)) __warnattr ("ptsname_r called with buflen bigger than " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:6: In file included from /usr/include/stdlib.h:1017: /usr/include/bits/stdlib.h:123:9: warning: mbstowcs called with dst buffer smaller than len * sizeof (wchar_t) [-Wuser-defined-warnings] return __mbstowcs_chk_warn (__dst, __src, __len, ^ /usr/include/bits/stdlib.h:109:6: note: from 'diagnose_if' attribute on '__mbstowcs_chk_warn': __warnattr ("mbstowcs called with dst buffer smaller than len " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:6: In file included from /usr/include/stdlib.h:1017: /usr/include/bits/stdlib.h:152:9: warning: wcstombs called with dst buffer smaller than len [-Wuser-defined-warnings] return __wcstombs_chk_warn (__dst, __src, __len, __bos (__dst)); ^ /usr/include/bits/stdlib.h:141:6: note: from 'diagnose_if' attribute on '__wcstombs_chk_warn': __warnattr ("wcstombs called with dst buffer smaller than len"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:7: In file included from /usr/include/string.h:494: /usr/include/bits/string_fortified.h:67:7: warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Wuser-defined-warnings] __warn_memset_zero_len (); ^ /usr/include/bits/string_fortified.h:26:1: note: from 'diagnose_if' attribute on '__warn_memset_zero_len': __warndecl (__warn_memset_zero_len, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:134:42: note: expanded from macro '__warndecl' extern void name (void) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:42:9: warning: read called with bigger length than size of the destination buffer [-Wuser-defined-warnings] return __read_chk_warn (__fd, __buf, __nbytes, __bos0 (__buf)); ^ /usr/include/bits/unistd.h:30:12: note: from 'diagnose_if' attribute on '__read_chk_warn': __wur __warnattr ("read called with bigger length than size of " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:148:9: warning: readlink called with bigger length than size of destination buffer [-Wuser-defined-warnings] return __readlink_chk_warn (__path, __buf, __len, __bos (__buf)); ^ /usr/include/bits/unistd.h:135:31: note: from 'diagnose_if' attribute on '__readlink_chk_warn': __nonnull ((1, 2)) __wur __warnattr ("readlink called with bigger length " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:182:9: warning: readlinkat called with bigger length than size of destination buffer [-Wuser-defined-warnings] return __readlinkat_chk_warn (__fd, __path, __buf, __len, ^ /usr/include/bits/unistd.h:168:31: note: from 'diagnose_if' attribute on '__readlinkat_chk_warn': __nonnull ((2, 3)) __wur __warnattr ("readlinkat called with bigger " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:208:9: warning: getcwd caller with bigger length than size of destination buffer [-Wuser-defined-warnings] return __getcwd_chk_warn (__buf, __size, __bos (__buf)); ^ /usr/include/bits/unistd.h:196:12: note: from 'diagnose_if' attribute on '__getcwd_chk_warn': __wur __warnattr ("getcwd caller with bigger length than size of " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:225:10: warning: please use getcwd instead, as getwd doesn't specify buffer size [-Wuser-defined-warnings] return __getwd_warn (__buf); ^ /usr/include/bits/unistd.h:217:28: note: from 'diagnose_if' attribute on '__getwd_warn': __nonnull ((1)) __wur __warnattr ("please use getcwd instead, as getwd " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:248:9: warning: confstr called with bigger length than size of destination buffer [-Wuser-defined-warnings] return __confstr_chk_warn (__name, __buf, __len, __bos (__buf)); ^ /usr/include/bits/unistd.h:236:6: note: from 'diagnose_if' attribute on '__confstr_chk_warn': __warnattr ("confstr called with bigger length than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:273:9: warning: getgroups called with bigger group count than what can fit into destination buffer [-Wuser-defined-warnings] return __getgroups_chk_warn (__size, __list, __bos (__list)); ^ /usr/include/bits/unistd.h:261:12: note: from 'diagnose_if' attribute on '__getgroups_chk_warn': __wur __warnattr ("getgroups called with bigger group count than what " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:299:9: warning: ttyname_r called with bigger buflen than size of destination buffer [-Wuser-defined-warnings] return __ttyname_r_chk_warn (__fd, __buf, __buflen, __bos (__buf)); ^ /usr/include/bits/unistd.h:287:22: note: from 'diagnose_if' attribute on '__ttyname_r_chk_warn': __nonnull ((2)) __warnattr ("ttyname_r called with bigger buflen than " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:325:9: warning: getlogin_r called with bigger buflen than size of destination buffer [-Wuser-defined-warnings] return __getlogin_r_chk_warn (__buf, __buflen, __bos (__buf)); ^ /usr/include/bits/unistd.h:313:22: note: from 'diagnose_if' attribute on '__getlogin_r_chk_warn': __nonnull ((1)) __warnattr ("getlogin_r called with bigger buflen than " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:352:9: warning: gethostname called with bigger buflen than size of destination buffer [-Wuser-defined-warnings] return __gethostname_chk_warn (__buf, __buflen, __bos (__buf)); ^ /usr/include/bits/unistd.h:340:22: note: from 'diagnose_if' attribute on '__gethostname_chk_warn': __nonnull ((1)) __warnattr ("gethostname called with bigger buflen than " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:10: In file included from /usr/include/unistd.h:1166: /usr/include/bits/unistd.h:381:9: warning: getdomainname called with bigger buflen than size of destination buffer [-Wuser-defined-warnings] return __getdomainname_chk_warn (__buf, __buflen, __bos (__buf)); ^ /usr/include/bits/unistd.h:368:28: note: from 'diagnose_if' attribute on '__getdomainname_chk_warn': __nonnull ((1)) __wur __warnattr ("getdomainname called with bigger " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:49:9: warning: wmemcpy called with length bigger than size of destination buffer [-Wuser-defined-warnings] return __wmemcpy_chk_warn (__s1, __s2, __n, ^ /usr/include/bits/wchar2.h:35:6: note: from 'diagnose_if' attribute on '__wmemcpy_chk_warn': __warnattr ("wmemcpy called with length bigger than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:77:9: warning: wmemmove called with length bigger than size of destination buffer [-Wuser-defined-warnings] return __wmemmove_chk_warn (__s1, __s2, __n, ^ /usr/include/bits/wchar2.h:64:6: note: from 'diagnose_if' attribute on '__wmemmove_chk_warn': __warnattr ("wmemmove called with length bigger than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:137:9: warning: wmemset called with length bigger than size of destination buffer [-Wuser-defined-warnings] return __wmemset_chk_warn (__s, __c, __n, ^ /usr/include/bits/wchar2.h:125:6: note: from 'diagnose_if' attribute on '__wmemset_chk_warn': __warnattr ("wmemset called with length bigger than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:200:9: warning: wcsncpy called with length bigger than size of destination buffer [-Wuser-defined-warnings] return __wcsncpy_chk_warn (__dest, __src, __n, ^ /usr/include/bits/wchar2.h:187:6: note: from 'diagnose_if' attribute on '__wcsncpy_chk_warn': __warnattr ("wcsncpy called with length bigger than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:231:9: warning: wcpncpy called with length bigger than size of destination buffer [-Wuser-defined-warnings] return __wcpncpy_chk_warn (__dest, __src, __n, ^ /usr/include/bits/wchar2.h:218:6: note: from 'diagnose_if' attribute on '__wcpncpy_chk_warn': __warnattr ("wcpncpy called with length bigger than size of destination " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:393:9: warning: fgetws called with bigger size than length of destination buffer [-Wuser-defined-warnings] return __fgetws_chk_warn (__s, __bos (__s) / sizeof (wchar_t), ^ /usr/include/bits/wchar2.h:380:12: note: from 'diagnose_if' attribute on '__fgetws_chk_warn': __wur __warnattr ("fgetws called with bigger size than length " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:484:9: warning: mbsrtowcs called with dst buffer smaller than len * sizeof (wchar_t) [-Wuser-defined-warnings] return __mbsrtowcs_chk_warn (__dst, __src, __len, __ps, ^ /usr/include/bits/wchar2.h:470:6: note: from 'diagnose_if' attribute on '__mbsrtowcs_chk_warn': __warnattr ("mbsrtowcs called with dst buffer smaller than len " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ In file included from foo.c:11: In file included from /usr/include/wchar.h:848: /usr/include/bits/wchar2.h:517:9: warning: wcsrtombs called with dst buffer smaller than len [-Wuser-defined-warnings] return __wcsrtombs_chk_warn (__dst, __src, __len, __ps, __bos (__dst)); ^ /usr/include/bits/wchar2.h:505:5: note: from 'diagnose_if' attribute on '__wcsrtombs_chk_warn': __warnattr ("wcsrtombs called with dst buffer smaller than len"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/cdefs.h:135:41: note: expanded from macro '__warnattr' # define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) ^ ~ 29 warnings generated. --nextPart8751244.t73vNALQW0 Content-Disposition: attachment; filename="clang-warnings.tar.gz" Content-Transfer-Encoding: base64 Content-Type: application/x-compressed-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