[pcre-dev] [Bug 1072] New: build on Solaris: missing include…

Etusivu
Poista viesti
Lähettäjä: Ivan Pechorin
Päiväys:  
Vastaanottaja: pcre-dev
Uudet otsikot: [pcre-dev] [Bug 1072] build on Solaris: missing include <string.h>
Aihe: [pcre-dev] [Bug 1072] New: build on Solaris: missing include <string.h>
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1072
           Summary: build on Solaris: missing include <string.h>
           Product: PCRE
           Version: N/A
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: bug
          Priority: low
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: ivan.pechorin@???
                CC: pcre-dev@???



Created an attachment (id=451)
--> (http://bugs.exim.org/attachment.cgi?id=451)
trivial patch that fixes the problem for me

Building PCRE on Solaris 10/SPARC using Sun Studio 12U2 gives me few
compilation errors:

1) /bin/bash ./libtool --tag=CXX   --mode=compile CC -DHAVE_CONFIG_H -I.     -g
-KPIC -mt -m32 -xarch=sparc -library=stlport4 -c -o pcrecpp.lo pcrecpp.cc
libtool: compile:  CC -DHAVE_CONFIG_H -I. -g -KPIC -mt -m32 -xarch=sparc
-library=stlport4 -c pcrecpp.cc  -KPIC -DPIC -o .libs/pcrecpp.o
"pcrecpp.cc", line 714: Error: The function "memcpy" must have a prototype.
"pcrecpp.cc", line 874: Error: The function "memcpy" must have a prototype.
2 Error(s) detected.


2) CC -DHAVE_CONFIG_H -I.     -g -KPIC -mt -m32 -xarch=sparc -library=stlport4
-c -o pcrecpp_unittest.o pcrecpp_unittest.cc
"pcrecpp_unittest.cc", line 824: Error: The function "strcmp" must have a
prototype.
"pcrecpp_unittest.cc", line 826: Error: The function "strcmp" must have a
prototype.
"pcrecpp_unittest.cc", line 828: Error: The function "strcmp" must have a
prototype.
"pcrecpp_unittest.cc", line 1062: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1067: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1073: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1080: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1088: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1098: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1109: Error: The function "memset" must have a
prototype.
"pcrecpp_unittest.cc", line 1121: Error: The function "memset" must have a
prototype.
11 Error(s) detected.


3) CC -DHAVE_CONFIG_H -I.     -g -KPIC -mt -m32 -xarch=sparc -library=stlport4
-c -o pcre_scanner_unittest.o pcre_scanner_unittest.cc
"pcre_scanner_unittest.cc", line 109: Error: The function "strchr" must have a
prototype.
"pcre_scanner_unittest.cc", line 113: Error: The function "strchr" must have a
prototype.
"pcre_scanner_unittest.cc", line 121: Error: The function "strchr" must have a
prototype.
"pcre_scanner_unittest.cc", line 122: Error: The function "strchr" must have a
prototype.
4 Error(s) detected.


The fix is trivial of course: man pages for "memcpy", "memset", "strcmp", and
"strchr" suggested that #include <string.h> is necessary. Trivial patch is
attached.

I'm not sure if it's proper or cross-platform way to fix it, but I'm not
proficient enough with autotools to provide any patch to the configure/build
system of PCRE to detect automatically if #include <string.h> is needed on
particular build host.

Details of my build host:

# uname -a
SunOS ugadb1 5.10 Generic_141444-09 sun4v sparc SUNW,T5140

# cc -V
cc: Sun C 5.11 SunOS_sparc 2010/08/13

# CC -V
CC: Sun C++ 5.11 SunOS_sparc 2010/08/13

CC=cc
CXX=CC
CFLAGS="-g -KPIC -mt -m32 -xarch=sparc"
CXXFLAGS="${CFLAGS} -library=stlport4"


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email