public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* ATTRIBUTE_NONSTRING
@ 2018-04-27  3:17 Alan Modra
  2018-04-27 22:27 ` ATTRIBUTE_NONSTRING Hans-Peter Nilsson
  2018-04-30 18:21 ` ATTRIBUTE_NONSTRING Pedro Alves
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Modra @ 2018-04-27  3:17 UTC (permalink / raw)
  To: gcc-patches; +Cc: DJ Delorie, Ian Lance Taylor

This patch adds ATTRIBUTE_NONSTRING, which will be used to curb
-Wstringop-truncation warnings in binutils.  OK to apply?

	* ansidecl.h (ATTRIBUTE_NONSTRING): Define.

diff --git a/include/ansidecl.h b/include/ansidecl.h
index c11daff..ec5f34d 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -283,6 +283,15 @@ So instead we use the macro below and test it against specific values.  */
 # endif /* GNUC >= 4.9 */
 #endif /* ATTRIBUTE_NO_SANITIZE_UNDEFINED */
 
+/* Attribute 'nonstring' was valid as of gcc 8.  */
+#ifndef ATTRIBUTE_NONSTRING
+# if GCC_VERSION >= 8000
+#  define ATTRIBUTE_NONSTRING __attribute__ ((nonstring))
+# else
+#  define ATTRIBUTE_NONSTRING
+# endif
+#endif
+
 /* We use __extension__ in some places to suppress -pedantic warnings
    about GCC extensions.  This feature didn't work properly before
    gcc 2.8.  */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-01 17:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27  3:17 ATTRIBUTE_NONSTRING Alan Modra
2018-04-27 22:27 ` ATTRIBUTE_NONSTRING Hans-Peter Nilsson
2018-04-28  6:46   ` ATTRIBUTE_NONSTRING Alan Modra
2018-05-01 17:28     ` ATTRIBUTE_NONSTRING Jeff Law
2018-04-30 18:21 ` ATTRIBUTE_NONSTRING Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).