https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115880

            Bug ID: 115880
           Summary: [14 regression] GCC 14+ fails to parse CoreFoundation
                    header
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egallager at gcc dot gnu.org
                CC: iains at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-apple-darwin

Testcase:

$ cat cf_include.c
#include <CoreFoundation/CoreFoundation.h>
$

My self-built copy of GCC (14.0) in /usr/local from last November compiles it
fine, but my MacPorts-built copy (14.1) in /opt/local from earlier this month
fails to compile it with:

$ /opt/local/bin/gcc -c cf_include.c
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43,
                 from cf_include.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:126:1:
error: attributes should be specified before the declarator in a function
definition
  126 | CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i)
API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return
((CFOptionFlags)(1UL << (8 + i)));}
      | ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:127:1:
error: attributes should be specified before the declarator in a function
definition
  127 | CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i)
API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return
((CFOptionFlags)(1UL << (16 + i)));}
      | ^~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:128:1:
error: attributes should be specified before the declarator in a function
definition
  128 | CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n)
API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return
((CFOptionFlags)(n << 24));}
      | ^~~~~~~~~
$

Perhaps the header needs to be fixincluded? If so, this bug would depend on bug
105719.

Reply via email to