[bug #66071] NSUserNotification unusable when compiled with GCC

Yavor Doganov <[email protected]> Fri, 9 Aug 2024 06:30:38 -0400 (EDT)
Newsgroups gmane.comp.lib.gnustep.bugs
Message-ID <[email protected]>
--8323329-876830460-1723199438=:2914777
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/bugs/?66071>=0A=0A                 Summa=
ry: NSUserNotification unusable when compiled with GCC=0A                  =
 Group: GNUstep=0A               Submitter: yavor=0A               Submitte=
d: Fri 09 Aug 2024 01:30:35 PM EEST=0A                Category: Base/Founda=
tion=0A                Severity: 3 - Normal=0A              Item Group: Bug=
=0A                  Status: None=0A                 Privacy: Public=0A    =
         Assigned to: None=0A             Open/Closed: Open=0A         Disc=
ussion Lock: Any=0A=0A=0A    ______________________________________________=
_________=0A=0AFollow-up Comments:=0A=0A=0A--------------------------------=
-----------------------=0ADate: Fri 09 Aug 2024 01:30:35 PM EEST By: Yavor =
Doganov <yavor>=0A[Sorry for submitting at Savannah but I have no way to us=
e the bug reporting=0Afacility you have chosen.]=0A=0ABase 1.30.0, GCC 14.2=
.0, GNU/Linux amd64 (x86_64)=0A=0AA test program using NSUserNotification/N=
SUserNotificationCenter compiles fine=0Abut fails at link time due to missi=
ng symbols (and indeed, objdump confirms=0Athat __objc_class_name_NSUserNot=
ification and=0A__objc_class_name_NSUserNotificationCenter are not in the s=
ymbols table).=0A=0AIt looks like GCC requires the ivars to be declared in =
addition to the=0A@property declarations and it also requires explicit @syn=
thesize to actually=0Ado the job of generating the setters/getters definiti=
ons.  The former is=0Asomewhat logical since GCC does not support nonfragil=
e ivars.=0A=0AGCC 14 started diagnosing this:=0A=0Agcc NSUserNotification.m=
 -c \=0A      -MMD -MP -Wdate-time -D_FORTIFY_SOURCE=3D2 -DGNUSTEP_TARGET_D=
IR=3D\".\"=0A-DGNUSTEP_TARGET_CPU=3D\"x86_64\" -DGNUSTEP_TARGET_OS=3D\"linu=
x-gnu\"=0A-DGNUSTEP_IS_FLATTENED=3D\"yes\" -DLIBRARY_COMBO=3D\"gnu-gnu-gnu\=
"=0A-DGNUSTEP_BASE_INTERNAL=3D1 -Wall -Wdeclaration-after-statement -Wcast-=
align=0A-DGNUSTEP -DGNUSTEP_BASE_LIBRARY=3D1 -DGNU_RUNTIME=3D1 -DGNUSTEP_BA=
SE_LIBRARY=3D1=0A-fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NAT=
IVE_OBJC_EXCEPTIONS=0A-pthread -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-impor=
t -g -O2 -g -O2=0A-ffile-prefix-map=3D/<<PKGBUILDDIR>>=3D. -fstack-protecto=
r-strong=0A-fstack-clash-protection -Wformat -Werror=3Dformat-security -fcf=
-protection=0A-fconstant-string-class=3DNSConstantString -I../Headers -I./.=
 -I.=0A-I/usr/local/include/GNUstep -I/usr/include/GNUstep -Wdate-time=0A-D=
_FORTIFY_SOURCE=3D2 -I/usr/local/include/GNUstep -I/usr/local/include/GNUst=
ep=0A-I/usr/include/GNUstep -I/usr/include/libxml2 -I/usr/include/libxml2=
=0A-I/usr/include/p11-kit-1 \=0A       -o obj/libgnustep-base.obj/NSUserNot=
ification.m.o=0ANSUserNotification.m:42:31: warning: object property =E2=80=
=98actualDeliveryDate=E2=80=99=0Ahas no =E2=80=98assign=E2=80=99, =E2=80=98=
retain=E2=80=99 or =E2=80=98copy=E2=80=99 attribute; assuming=0A=E2=80=98as=
sign=E2=80=99=0A   42 | @property (readwrite) NSDate *actualDeliveryDate;=
=0A      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~=0ANSUserNotific=
ation.m:42:31: note: =E2=80=98assign=E2=80=99 can be unsafe for Objective-C=
=0Aobjects; please state explicitly if you need it=0ANSUserNotification.m:4=
6:43: warning: object property =E2=80=98response=E2=80=99 has no=0A=E2=80=
=98assign=E2=80=99, =E2=80=98retain=E2=80=99 or =E2=80=98copy=E2=80=99 attr=
ibute; assuming =E2=80=98assign=E2=80=99=0A   46 | @property (readwrite) NS=
AttributedString *response;=0A      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~^~~~~~~~=0ANSUserNotification.m:46:43: note: =E2=80=98assign=E2=80=99 =
can be unsafe for Objective-C=0Aobjects; please state explicitly if you nee=
d it=0ANSUserNotification.m:89:1: warning: incomplete implementation of cla=
ss=0A=E2=80=98NSUserNotification=E2=80=99=0A   89 | @end=0A      | ^=0ANSUs=
erNotification.m:89:1: warning: method definition for=0A=E2=80=98-setActual=
DeliveryDate:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: meth=
od definition for =E2=80=98-setPresented:=E2=80=99=0Anot found=0ANSUserNoti=
fication.m:89:1: warning: method definition for =E2=80=98-setRemote:=E2=80=
=99=0Anot found=0ANSUserNotification.m:89:1: warning: method definition for=
=0A=E2=80=98-setActivationType:=E2=80=99 not found=0ANSUserNotification.m:8=
9:1: warning: method definition for =E2=80=98-setResponse:=E2=80=99=0Anot f=
ound=0ANSUserNotification.m:89:1: warning: method definition for =E2=80=98-=
setTitle:=E2=80=99 not=0Afound=0ANSUserNotification.m:89:1: warning: method=
 definition for =E2=80=98-title=E2=80=99 not=0Afound=0ANSUserNotification.m=
:89:1: warning: method definition for =E2=80=98-setSubtitle:=E2=80=99=0Anot=
 found=0ANSUserNotification.m:89:1: warning: method definition for =E2=80=
=98-subtitle=E2=80=99 not=0Afound=0ANSUserNotification.m:89:1: warning: met=
hod definition for=0A=E2=80=98-setInformativeText:=E2=80=99 not found=0ANSU=
serNotification.m:89:1: warning: method definition for=0A=E2=80=98-informat=
iveText=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method def=
inition for=0A=E2=80=98-setActionButtonTitle:=E2=80=99 not found=0ANSUserNo=
tification.m:89:1: warning: method definition for=0A=E2=80=98-actionButtonT=
itle=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method defini=
tion for =E2=80=98-setUserInfo:=E2=80=99=0Anot found=0ANSUserNotification.m=
:89:1: warning: method definition for =E2=80=98-userInfo=E2=80=99 not=0Afou=
nd=0ANSUserNotification.m:89:1: warning: method definition for=0A=E2=80=98-=
setDeliveryDate:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: m=
ethod definition for =E2=80=98-deliveryDate=E2=80=99=0Anot found=0ANSUserNo=
tification.m:89:1: warning: method definition for=0A=E2=80=98-setDeliveryTi=
meZone:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method def=
inition for=0A=E2=80=98-deliveryTimeZone=E2=80=99 not found=0ANSUserNotific=
ation.m:89:1: warning: method definition for=0A=E2=80=98-setDeliveryRepeatI=
nterval:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method de=
finition for=0A=E2=80=98-deliveryRepeatInterval=E2=80=99 not found=0ANSUser=
Notification.m:89:1: warning: method definition for=0A=E2=80=98-actualDeliv=
eryDate=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method def=
inition for =E2=80=98-isPresented=E2=80=99=0Anot found=0ANSUserNotification=
.m:89:1: warning: method definition for =E2=80=98-isRemote=E2=80=99 not=0Af=
ound=0ANSUserNotification.m:89:1: warning: method definition for =E2=80=98-=
setSoundName:=E2=80=99=0Anot found=0ANSUserNotification.m:89:1: warning: me=
thod definition for =E2=80=98-soundName=E2=80=99 not=0Afound=0ANSUserNotifi=
cation.m:89:1: warning: method definition for=0A=E2=80=98-setHasActionButto=
n:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method definiti=
on for=0A=E2=80=98-hasActionButton=E2=80=99 not found=0ANSUserNotification.=
m:89:1: warning: method definition for=0A=E2=80=98-activationType=E2=80=99 =
not found=0ANSUserNotification.m:89:1: warning: method definition for=0A=E2=
=80=98-setOtherButtonTitle:=E2=80=99 not found=0ANSUserNotification.m:89:1:=
 warning: method definition for=0A=E2=80=98-otherButtonTitle=E2=80=99 not f=
ound=0ANSUserNotification.m:89:1: warning: method definition for=0A=E2=80=
=98-setIdentifier:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning:=
 method definition for =E2=80=98-identifier=E2=80=99=0Anot found=0ANSUserNo=
tification.m:89:1: warning: method definition for=0A=E2=80=98-setContentIma=
ge:=E2=80=99 not found=0ANSUserNotification.m:89:1: warning: method definit=
ion for =E2=80=98-contentImage=E2=80=99=0Anot found=0ANSUserNotification.m:=
89:1: warning: method definition for=0A=E2=80=98-setHasReplyButton:=E2=80=
=99 not found=0ANSUserNotification.m:89:1: warning: method definition for=
=0A=E2=80=98-hasReplyButton=E2=80=99 not found=0ANSUserNotification.m:89:1:=
 warning: method definition for=0A=E2=80=98-setResponsePlaceholder:=E2=80=
=99 not found=0ANSUserNotification.m:89:1: warning: method definition for=
=0A=E2=80=98-responsePlaceholder=E2=80=99 not found=0ANSUserNotification.m:=
89:1: warning: method definition for =E2=80=98-response=E2=80=99 not=0Afoun=
d=0ANSUserNotification.m:92:32: warning: object property=0A=E2=80=98deliver=
edNotifications=E2=80=99 has no =E2=80=98assign=E2=80=99, =E2=80=98retain=
=E2=80=99 or =E2=80=98copy=E2=80=99=0Aattribute; assuming =E2=80=98assign=
=E2=80=99=0A   92 | @property (readwrite) NSArray *deliveredNotifications;=
=0A      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~=0ANSUserNo=
tification.m:92:32: note: =E2=80=98assign=E2=80=99 can be unsafe for Object=
ive-C=0Aobjects; please state explicitly if you need it=0ANSUserNotificatio=
n.m:286:1: warning: incomplete implementation of class=0A=E2=80=98NSUserNot=
ificationCenter=E2=80=99=0A  286 | @end=0A      | ^=0ANSUserNotification.m:=
286:1: warning: method definition for=0A=E2=80=98-setDeliveredNotifications=
:=E2=80=99 not found=0ANSUserNotification.m:286:1: warning: method definiti=
on for =E2=80=98-setDelegate:=E2=80=99=0Anot found=0ANSUserNotification.m:2=
86:1: warning: method definition for =E2=80=98-delegate=E2=80=99 not=0Afoun=
d=0ANSUserNotification.m:286:1: warning: method definition for=0A=E2=80=98-=
setScheduledNotifications:=E2=80=99 not found=0ANSUserNotification.m:286:1:=
 warning: method definition for=0A=E2=80=98-scheduledNotifications=E2=80=99=
 not found=0ANSUserNotification.m:286:1: warning: method definition for=0A=
=E2=80=98-deliveredNotifications=E2=80=99 not found=0A=0A=0AThe attached pa=
tch works for me (my test program links and works as intended)=0Abut I am n=
ot sure it is correct.=0A=0A=0A=0A=0A=0A=0A    ____________________________=
___________________________=0AFile Attachments:=0A=0A=0A-------------------=
------------------------------------=0AName: gcc-synthesize.patch  Size: 3K=
iB=0A<https://file.savannah.gnu.org/file/gcc-synthesize.patch?file_id=3D563=
41>=0A=0A    AGPL NOTICE=0A=0AThese attachments are served by Savane. You c=
an download the corresponding=0Asource code of Savane at=0Ahttps://git.sava=
nnah.nongnu.org/cgit/administration/savane.git/snapshot/savane-42116cd7967f=
bdc599220dfcf475ac6c60083cb6.tar.gz=0A=0A    ______________________________=
_________________________=0A=0AReply to this item at:=0A=0A  <https://savan=
nah.gnu.org/bugs/?66071>=0A=0A_____________________________________________=
__=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-876830460-1723199438=:2914777
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZrXvzgAKCRCqLAuaBUf3
TnrOAP0TdpLJ9MohzPxB1pScoQIYcwa98NJKmH+B/gM2zMH+NwEAxBFrBF0b6YAZ
au6l5VAFhdBIvIBA2oQnIoAyP/mFkA0=
=kBzU
-----END PGP SIGNATURE-----

--8323329-876830460-1723199438=:2914777--