Re: Re: ext/fileinfo/libmagic/apprentice.c", line 2195: error: syntax error

From: Date: Wed, 05 Oct 2016 16:51:48 +0000
Subject: Re: Re: ext/fileinfo/libmagic/apprentice.c", line 2195: error: syntax error
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-96253@lists.php.net to get a copy of this message
Not sure where the definition of "offsetof()" is located but something seems clearly not C compliant here. So this is using the Oracle Studio 12.5 compiler tools on a big old SPARC box running Solaris 10. Any input would be appreciated. The cflags were permissive and allowed for transition type elements as I note that C99 with strict compliance will fail horribly. The configure stage was reasonably clean also. In any case .. any input would be greatly appreciated.
offsetof() is supposed to be declared in <stddef.h>[1]. Perhaps it would need a typedef for your system?
hrmmm ... I don't think that is the issue here. Definately have that header and this is a POSIX compliant system for sure. In fact, from my $HOME/.profile : #
# ident "@(#)local.profile      1.10    Dec 11 20:25:36 GMT 2014 ccode"
stty istrip MAIL=/usr/mail/${LOGNAME:?} # Standards, Environments, and Macros fully supported within UNIX # ---------------------------------------------------------------
#    This system supports IEEE Std 1003.1 and IEEE Std 1003.2,
#    commonly  known  as  POSIX.1  and POSIX.2, respectively.
#    Solaris 10 also  supports  the  X/Open  Common  Applications
#    Environment (CAE) Portability Guide Issue 3 (XPG3) and Issue
#    4 (XPG4); Single UNIX  Specification  (SUS,  also  known  as
#    XPG4v2);  Single  UNIX Specification, Version 2 (SUSv2); and
#    Single UNIX Specification, Version 3 (SUSv3). Both XPG4  and
#    SUS  include  Networking  Services  Issue  4  (XNS4).  SUSv2
#    includes Networking Services Issue 5 (XNS5).
#
#    This is a fully LP64 (64-bit) environment and is fully
#    compliant with The Open Group's UNIX 03 Product Standard.
#    An application that wants to use standard-conforming  utili-
#    tues  must  set  the PATH (sh(1) or ksh(1)) or path (csh(1))
#    environment variable to specify the directories listed below
#    in the order specified to get the appropriate utilities:
#
#    POSIX.1-2001, SUSv3
#
#            1.   /usr/xpg6/bin
#
#            2.   /usr/xpg4/bin
#
#            3.   /usr/ccs/bin
#
#            4.   /usr/bin
#
#            5.   directory containing binaries for your compiler
#
#            6.   other directories containing binaries needed by
#                 the application
#
#    When an application uses execlp() or execvp() (see  exec(2))
#    to  execute a shell file, or uses system(3C), the shell used
#    to interpret the shell file depends on the standard to which
#    the caller conforms.
#
#    See full details in standards(5) and at The OPEN Group(tm) or
#    Oracle web sites.
# # --------------------------------------------------------------- PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/jdk/latest/bin:/usr/local/ssl/bin:/usr/bin:/opt/developerstudio12.5/bin:/sbin:/bin:/usr/sbin:/usr/dt/bin:/usr/openwin/bin:/usr/X11/bin:/opt/schily/bin:/usr/local/texlive/2012/bin/sparc-solaris export PATH pretty sure I can carve that back to just items 1 to 6 above and use C99 compiler /opt/developerstudio12.5/bin/c99 and cflags options -Xc to be really really strict. I think the error message is about the use of the "struct" keyword there.
[1] <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html>
yep .. know it well. I may just have to change the sources a wee bit and see what happens here. Maybe this is a GCC GNUism that snuck in. dc

« previous php.internals (#96253) next »