corrode icon indicating copy to clipboard operation
corrode copied to clipboard

The symbol `bsd_signal` does not fit here.

Open bluejekyll opened this issue 8 years ago • 4 comments

Getting this error on macOS, trying to use corrode with a signal.h inclusion.

/usr/include/signal.h:79: (column 19) [ERROR]  >>> Syntax Error !
  Syntax error !
  The symbol `bsd_signal' does not fit here.

this is the line in that header:

void  (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);

That's wrapped in a #ifndef _ANSI_SOURCE

so, passing -D__DARWIN_C_LEVEL=200112 is a workaround for this. This setting seems to be the max for the system, that probably raises the minimum macOS version for targets.

Perhaps instead of a bug, what is needed is a standard definition of compiler flags for macOS?

related: #81 , #82 , #99

bluejekyll avatar Jan 27 '17 19:01 bluejekyll

Similar issue with

/usr/include/pthread.h:243: (column 20) [ERROR]  >>> Syntax Error !
  Syntax error !
  The symbol `*' does not fit here.

adding -D"_Nullable=/**/" -D"_Nonnull=/**/" gets passed pthread.h

bluejekyll avatar Jan 27 '17 19:01 bluejekyll

Another system header:

("/usr/include/math.h": line 205): illegal undefined variable; check whether a real C compiler accepts this:
    __builtin_fabsf

adding -ffast-math will get rid of this.

bluejekyll avatar Jan 27 '17 19:01 bluejekyll

I have similar:

/usr/include/stdio.h:133: (column 19) [ERROR]  >>> Syntax Error !
  Syntax error !
  The symbol `_close' does not fit here.

Even with the most trivial of .c programs. Using latest macOS

CallumHoward avatar Feb 01 '17 01:02 CallumHoward

This may be addressed by https://github.com/jameysharp/corrode/pull/110

CallumHoward avatar Feb 01 '17 01:02 CallumHoward