Date: Fri, 14 Apr 2017 00:38:53 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: Mark Millard <markmi@dsl-only.net> Cc: svn-src-stable-11@freebsd.org Subject: Re: svn commit: r316779 - stable/11/sys/sys Message-ID: <DE49DA85-DE56-493F-931B-262429A7CD28@FreeBSD.org> In-Reply-To: <7B482BAF-6ACA-4303-88FF-4F3E3EDFB440@dsl-only.net> References: <7B482BAF-6ACA-4303-88FF-4F3E3EDFB440@dsl-only.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello; > On Apr 13, 2017, at 16:02, Mark Millard <markmi@dsl-only.net> wrote: >=20 >> Author: pfg >> Date: Thu Apr 13 18:28:40 2017 >> New Revision: 316779 >> URL:=20 >> https://svnweb.freebsd.org/changeset/base/316779 >>=20 >>=20 >> Log: >> Temporarily revert r315602. >> Bring back the definition for the GCC __nonnull() attribute. >>=20 >> Old versions of GCC, including the version installed the latest = 11-stable >> snapshot with pkg(8), still carry the old attributes. >>=20 >> The issue is easily fixed by rebuilding GCC but there is no need to = cause >> havoc in our user base. The definition by itself is harmless but it = should >> be removed again in the near future. >>=20 >> Modified: >> stable/11/sys/sys/cdefs.h >> Directory Properties: >> stable/11/ (props changed) >>=20 >> Modified: stable/11/sys/sys/cdefs.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- stable/11/sys/sys/cdefs.h Thu Apr 13 18:13:10 2017 = (r316778) >> +++ stable/11/sys/sys/cdefs.h Thu Apr 13 18:28:40 2017 = (r316779) >> @@ -376,6 +376,14 @@ >> #define __noinline >> #endif >>=20 >> +#if __GNUC_PREREQ__(3, 3) >> +#define __nonnull(x) __attribute__((__nonnull__(x))) >> +#define __nonnull_all __attribute__((__nonnull__)) >> +#else >> +#define __nonnull(x) >> +#define __nonnull_all >> +#endif >> + >> #if __GNUC_PREREQ__(3, 4) >> #define __fastcall __attribute__((__fastcall__)) >> #define __result_use_check = __attribute__((__warn_unused_result__)) >=20 >=20 > My understanding was that __attribute__((__nonnull__(x))) and > __attribute__((__nonnull__)) were causing some problems > because of optimization consequences (code removal). The goal > of converting to the new technique (involving lack of > __nonnull and lack of __nonnull_all ) was to still have > warning notices but without such removal of code if I > understand right. >=20 > If avoiding code removal was the intent behind the removal > of __nonnull (and __nonnull_all) use (and use of the > __nonull__ attributes) then just having the two lines: >=20 > +#define __nonnull(x) > +#define __nonnull_all=20 >=20 > might be better for maintaining compatibility with existing > older sources that reference __nonnull and/or __nonnull_all . >=20 Leaving empty definitions would have been indeed acceptable but I prefer to either openly drop support for an attribute or label it deprecated but still operational for a while than to lie. We previously removed all occurrences of the __nonnull() attribute from FreeBSD headers though so the change should really just be a no-op, in particular to clang users which stand for all user base and most ports. Pedro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DE49DA85-DE56-493F-931B-262429A7CD28>