[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GCC, Objective-C and C99
From: |
Alan Third |
Subject: |
Re: GCC, Objective-C and C99 |
Date: |
Fri, 28 Aug 2020 01:28:16 +0200 (CEST) |
On Thu, Aug 27, 2020 at 03:07:25PM -0700, Paul Eggert wrote:
> On 8/27/20 2:24 PM, Alan Third wrote:
> > What's really odd is that I never had this problem when I built on a
> > VM based off Debian Jessie, but I now do with the Debian Stretch
> > Docker image. I guess something's changed with GCC.
>
> Perhaps the newer GCC no longer needs -std=c99 when compiling C files (so
> 'configure' doesn't add the option automatically), but for some reason GCC
> still rejects declarations in for loops when compiling Objective C files
> unless you also specify -std=c99.
>
> If this guess is correct, perhaps simply putting -std=c99 into the following
> line in configure.ac would work around this GCC glitch.
>
> ## Extra CFLAGS applied to src/*.m files.
> GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fgnu-runtime -Wno-import
> -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1
> -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE"
I tried that (and I tried gnu99 too) but it made no difference:
https://emba.gnu.org/emacs/emacs/-/commit/445d18f97350d502067972d4291b9224b2f9d3c1
Oh wait, I think I see where that went wrong. That is only executed if
NS_GNUSTEP_CONFIG isn't set, which it probably will be. That part must
be a backup for if gnustep-config isn't usable.
I think I know what to do. Thanks!
--
Alan Third