Menu

#567 Fix a compile problem with sprintf on Solaris

2.14.1
closed-fixed
5
2009-11-09
2009-01-28
No

In oh_error.h, the poison pragma is used to prevent the use of the sprintf(). However, sprintf() is used in the system headers of some versions of Solaris. On these versions of Solaris, compile errors similar to the following occur:

...
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../utils -I../utils -I../marshal -I../ssl -I/opt/sfw/include -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Wpointer-arith -Wformat=2 -Wformat-security -Wformat-nonliteral -Wcast-qual -Wcast-align -Wshadow -Wredundant-decls -Wno-strict-aliasing -fno-strict-aliasing -Wno-unused-value -Werror -D_GNU_SOURCE -D_REENTRANT -fexceptions -MT oh_client.lo -MD -MP -MF .deps/oh_client.Tpo -c oh_client.cpp -fPIC -DPIC -o .libs/oh_client.o
In file included from /usr/include/sys/stream.h:28,
from /usr/include/netinet/in.h:66,
from /usr/include/sys/socket.h:45,
from ../marshal/strmsock.h:23,
from oh_client_session.h:21,
from oh_client.cpp:32:
/usr/include/sys/strft.h:112:4: attempt to use poisoned "sprintf"
/usr/include/sys/strft.h:114:4: attempt to use poisoned "sprintf"
gmake[1]: *** [oh_client.lo] Error 1

I have attached a patch, oh_error.h.patch, that removes the poison pragma when compiling on Solaris.

Discussion

  • Chris Rinaldo

    Chris Rinaldo - 2009-01-28

    Remove a poison pragma in oh_error.h when compiling on Solaris

     
  • Ric White

    Ric White - 2009-06-02

    Committed revision 7010.

     
  • Ric White

    Ric White - 2009-06-02
    • milestone: --> 898633
    • assigned_to: renierm --> ricwhite
    • status: open --> closed-fixed
     
  • Ric White

    Ric White - 2009-10-16
    • milestone: 898633 --> 974651
     
  • Ric White

    Ric White - 2009-11-09
    • milestone: 974651 --> 2.14.1
     

Log in to post a comment.

MongoDB Logo MongoDB