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

* Re: ATTRIBUTE_NONSTRING
  2018-04-27  3:17 ATTRIBUTE_NONSTRING Alan Modra
@ 2018-04-27 22:27 ` Hans-Peter Nilsson
  2018-04-28  6:46   ` ATTRIBUTE_NONSTRING Alan Modra
  2018-04-30 18:21 ` ATTRIBUTE_NONSTRING Pedro Alves
  1 sibling, 1 reply; 5+ messages in thread
From: Hans-Peter Nilsson @ 2018-04-27 22:27 UTC (permalink / raw)
  To: Alan Modra; +Cc: gcc-patches, DJ Delorie, Ian Lance Taylor

On Fri, 27 Apr 2018, Alan Modra wrote:

> 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))

Uglify nonstring (as __nonstring__)?

brgds, H-P

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

* Re: ATTRIBUTE_NONSTRING
  2018-04-27 22:27 ` ATTRIBUTE_NONSTRING Hans-Peter Nilsson
@ 2018-04-28  6:46   ` Alan Modra
  2018-05-01 17:28     ` ATTRIBUTE_NONSTRING Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2018-04-28  6:46 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches, DJ Delorie, Ian Lance Taylor

On Fri, Apr 27, 2018 at 06:24:28PM -0400, Hans-Peter Nilsson wrote:
> On Fri, 27 Apr 2018, Alan Modra wrote:
> 
> > 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))
> 
> Uglify nonstring (as __nonstring__)?

Yes, that would be better.  I copied the immediately preceding
ATTRIBUTE_NO_SANITIZE_UNDEFINED without thinking.

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: ATTRIBUTE_NONSTRING
  2018-04-27  3:17 ATTRIBUTE_NONSTRING Alan Modra
  2018-04-27 22:27 ` ATTRIBUTE_NONSTRING Hans-Peter Nilsson
@ 2018-04-30 18:21 ` Pedro Alves
  1 sibling, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2018-04-30 18:21 UTC (permalink / raw)
  To: Alan Modra, gcc-patches; +Cc: DJ Delorie, Ian Lance Taylor

On 04/27/2018 02:41 AM, Alan Modra wrote:
> This patch adds ATTRIBUTE_NONSTRING, which will be used to curb
> -Wstringop-truncation warnings in binutils.  OK to apply?
> 
> 	* ansidecl.h (ATTRIBUTE_NONSTRING): Define.

+1, FWIW.

Thanks,
Pedro Alves

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

* Re: ATTRIBUTE_NONSTRING
  2018-04-28  6:46   ` ATTRIBUTE_NONSTRING Alan Modra
@ 2018-05-01 17:28     ` Jeff Law
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Law @ 2018-05-01 17:28 UTC (permalink / raw)
  To: Alan Modra, Hans-Peter Nilsson; +Cc: gcc-patches, DJ Delorie, Ian Lance Taylor

On 04/28/2018 12:25 AM, Alan Modra wrote:
> On Fri, Apr 27, 2018 at 06:24:28PM -0400, Hans-Peter Nilsson wrote:
>> On Fri, 27 Apr 2018, Alan Modra wrote:
>>
>>> 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))
>>
>> Uglify nonstring (as __nonstring__)?
> 
> Yes, that would be better.  I copied the immediately preceding
> ATTRIBUTE_NO_SANITIZE_UNDEFINED without thinking.
OK with uglification.

jeff

^ 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).