Bug 203224 - lang/gcc49: unistd.h is busted (also lang/gcc5)
Summary: lang/gcc49: unistd.h is busted (also lang/gcc5)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-20 19:41 UTC by Conrad Meyer
Modified: 2015-11-07 13:56 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Meyer freebsd_committer freebsd_triage 2015-09-20 19:41:06 UTC
E.g.:

$ cat test.c
#include <unistd.h>
$ gcc49 -c test.c
In file included from test.c:1:0:
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h: In function 'execl':
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:343:45: error: expected declaration specifiers before '__sentinel'
 int  execl(const char *, const char *, ...) __sentinel;
                                             ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:345:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__sentinel'
 int  execlp(const char *, const char *, ...) __sentinel;
                                              ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:392:14: error: storage class specified for parameter 'optarg'
 extern char *optarg;   /* getopt(3) external variables */
              ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:393:12: error: storage class specified for parameter 'optind'
 extern int optind, opterr, optopt;
            ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:393:20: error: storage class specified for parameter 'opterr'
 extern int optind, opterr, optopt;
                    ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:393:28: error: storage class specified for parameter 'optopt'
 extern int optind, opterr, optopt;
                            ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:600:12: error: storage class specified for parameter 'optreset'
 extern int optreset;   /* getopt(3) external variable */
            ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:343:6: error: old-style parameter declarations in prototyped function definition
 int  execl(const char *, const char *, ...) __sentinel;
      ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:343:1: error: parameter name omitted
 int  execl(const char *, const char *, ...) __sentinel;
 ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd11.0/4.9.4/include-fixed/unistd.h:343:1: error: parameter name omitted
test.c:1:0: error: expected '{' at end of input
 #include <unistd.h>
 ^
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2015-09-20 19:41:32 UTC
Pretty broken!
Comment 2 Jilles Tjoelker freebsd_committer freebsd_triage 2015-09-20 20:14:26 UTC
This error is because gcc's fixincludes script has copied (and "fixed") some include files which are incompatible with the user's system (they're running an old -current that doesn't have __sentinel in <sys/cdefs.h>).

The workaround is to upgrade the system to a newer -current.

I notice that lang/gcc doesn't have an include-fixed directory at all (good), so perhaps a minor change is needed to avoid it in lang/gcc49 as well. I think neutralizing fixincludes completely somehow may be worth consideration, though.

Some background information about fixincludes is at http://ewontfix.com/12/
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2015-11-07 13:56:29 UTC
Matteo has reported this independently and Paolo addressed it by
renaming __sentinel to __null_sentinel, so current -CURRENT should
be fine.