Bug #1054

errors with signal.h

Added by Seung-Sep 2 months ago. Updated about 1 month ago.

Status:ClosedStart date:2017-02-25
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.3-svn Platform:Mac OS X

Description

I have the following error messages during "make install" process.
System info: Mac OS Sierra 10.12.3
Wonder if this is a Mac problem or something else.
Any suggestions to resolve this issue are welcomed.


[ 68%] Built target gmtlib
[ 68%] Building C object src/CMakeFiles/gmt.dir/gmt.c.o
[100%] Built target supplib
In file included from /Users/seungsep/HALE/GMTdev/gmt5/branches/5.3/src/gmt.c:33:0:
/usr/include/signal.h:79:19: error: expected ‘)’ before ‘bsd_signal’
void (* _Nullable bsd_signal(int, void (* _Nullable)(int)))(int);
^
In file included from /Users/seungsep/HALE/GMTdev/gmt5/branches/5.3/src/gmt.c:33:0:
/usr/include/signal.h:99:22: error: expected ‘)’ before ‘sigset’
void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
^
make2: * [src/CMakeFiles/gmt.dir/build.make:63: src/CMakeFiles/gmt.dir/gmt.c.o] Error 1
make1:
[CMakeFiles/Makefile2:439: src/CMakeFiles/gmt.dir/all] Error 2
make: *
* [Makefile:150: all] Error 2

Associated revisions

Revision 17644
Added by Paul about 1 month ago

Address issue #1054

History

#1 Updated by Seung-Sep about 1 month ago

I have compared signal.h of OS 10.10 with that of OS 10.12. The main difference is _Nullable statement. During the above compile, I have used gcc-5 installed via fink to enable openmpi flag. However, when I compiled it with the AppleClang (i.e., /usr/bin/gcc), I have no errors.

#2 Updated by Paul about 1 month ago

  • Status changed from New to Feedback

Wonder if you may have to update your gcc to the most recent version. If Apple stuffed something new in there I doubt they did that without it (Nullable) being something that others have agreed on

#3 Updated by Seung-Sep about 1 month ago

I have updated gcc-5 to gcc-6 and but still get the same error. Will look at it more..

#4 Updated by Paul about 1 month ago

See /usr/include/sys/cdefs.h which has stuff like

/* Compatibility with compilers and environments that don't support the
 * nullability feature.
 */

#if !__has_feature(nullability)
#ifndef __nullable
#define __nullable
#endif

Please try to include this include file in gmt.c just before the other signal stuff and let me know if this fixes it.

#5 Updated by Seung-Sep about 1 month ago

The error did not go away with the given statement. However, I included the following based on your suggestion and the error went away!

#ifndef _Nullable
#define _Nullable
#endif

Thanks for the help!

#6 Updated by Paul about 1 month ago

Great, and where exactly did you put those lines?

#7 Updated by Seung-Sep about 1 month ago

My gmt.c now has the following lines:

#include "gmt_dev.h"

#ifndef _Nullable
#define _Nullable
#endif

#if !(defined(WIN32) || defined(NO_SIGHANDLER))
  1. include <signal.h>
  2. include "common_sighandler.h"
    #endif

#8 Updated by Paul about 1 month ago

Do you mind testing if this works:

#if !(defined(WIN32) || defined(NO_SIGHANDLER))
#if    __APPLE__
    /* Apple Xcode expects _Nullable to be defined but it is not if gcc */
#    ifndef _Nullable
#    define _Nullable
#    endif
#    endif
#    include <signal.h>
#    include "common_sighandler.h" 
#endif

#9 Updated by Seung-Sep about 1 month ago

I was thinking the same sequence since it is an Apple issue.
And yes, it works great!

#10 Updated by Paul about 1 month ago

  • Status changed from Feedback to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

OK then, that is the solution implemented in r17644.

#11 Updated by Joaquim about 1 month ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF