Closed Bug 188079 Opened 23 years ago Closed 23 years ago

libical uses snprintf

Categories

(Calendar :: Internal Components, defect)

DEC
OpenVMS
defect
Not set
blocker

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: colin, Assigned: gray)

Details

Attachments

(1 file)

libical uses snprintf in several places: libicalss/icalfileset.c libical/icalparser.c libical/icalproperty.c libical/icalrestriction.c libical/icaltime.c libical/icaltimezone.c libical/icalvalue.c libical/icaltypes.c Not all platforms have snprintf (OpenVMS doesn't!), and for that reason, NSPR supports it. What's the best way to fix this? Just put the following some place? #define snprintf PR_snprintf If so, where? In each of the above files? Or is there a header file some place where we can put it?
libical comes with an snprintf implementation (in vsnprintf.c). We don't build it by default though. It would probably be less intrusive to just use that implementation using a Makefile check similar to what we do for dbm (which also contains a snprintf impl).
Build vsnprintf.c as Chris suggested. Had to fix the include of config.h because it wasn't right.
Attachment #110890 - Flags: first-review?(cls)
Comment on attachment 110890 [details] [diff] [review] Build vsnprintf for platforms which need it r=cls
Attachment #110890 - Flags: first-review?(cls) → first-review+
Fixes checked in. Closing.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Uh... It isn't building for me! (Win32) Build log: make[5]: Entering directory `/cygdrive/c/mozilla/other-licenses/libical/src/libical' ... vsnprintf.c Building deps for c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c cl -Fovsnprintf.obj -c -DOSTYPE=\"WINNT5.1\" -DOSARCH=\"WINNT\" -DOJI -I. -Ic:/mozilla/other-licenses/libical/src/libical -I../../../../dist/include/ical -I../../../../dist/include -I../../../../dist/include/nspr -G6 -TC -W3 -nologo -Gy -Fdmozical.pdb -DNDEBUG -DTRIMMED -O1 /DEF:c:/mozilla/other-licenses/libical/src/libical/ical.def -MD -DHAVE_MMINTRIN_H=1 -D_WINDOWS=1 -D_WIN32=1 -DWIN32=1 -DXP_PC=1 -DXP_WIN=1 -DXP_WIN32=1 -DHW_THREADS=1 -DWINVER=0x400 -DMSVC4=1 -DSTDC_HEADERS=1 -DNEW_H=\<new\> -DWIN32_LEAN_AND_MEAN=1 -DNO_X11=1 -D_X86_=1 -DD_INO=d_ino -DMOZ_DEFAULT_TOOLKIT=\"windows\" -DMOZ_ENABLE_COREXFONTS=1 -DIBMBIDI=1 -DACCESSIBILITY=1 -DMOZ_MATHML=1 -DMOZ_SVG=1 -DMOZ_LOGGING=1 -DMOZ_USER_DIR=\".mozilla\" -DCPP_THROW_NEW=throw\(\) -DMOZ_XUL=1 -DINCLUDE_XUL=1 -DNS_MT_SUPPORTED=1 -DMOZ_DLL_SUFFIX=\".dll\" -DXP_PC=1 -DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZILLA_CLIENT c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c vsnprintf.c c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(56) : error C2061: syntax error : identifier 'bail' c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(56) : error C2059: syntax error : ';' c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(70) : warning C4013: 'getpagesize' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(71) : warning C4013: 'malloc' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(76) : warning C4013: 'mprotect' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(76) : error C2065: 'PROT_NONE' : undeclared identifier c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(77) : warning C4013: 'free' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(89) : warning C4013: 'siglongjmp' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(89) : error C2065: 'bail' : undeclared identifier c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(100) : error C2065: 'caddr_t' : undeclared identifier c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(100) : error C2064: term does not evaluate to a function c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(101) : error C2065: 'PROT_READ' : undeclared identifier c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(101) : error C2065: 'PROT_WRITE' : undeclared identifier c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(101) : error C2065: 'PROT_EXEC' : undeclared identifier c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(102) : error C2064: term does not evaluate to a function c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(118) : error C2079: 'osa' uses undefined struct 'sigaction' c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(118) : error C2079: 'nsa' uses undefined struct 'sigaction' c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(123) : error C2224: left of '.sa_handler' must have struct/union type c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(124) : warning C4013: 'sigemptyset' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(124) : error C2224: left of '.sa_mask' must have struct/union type c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(131) : warning C4013: 'sigsetjmp' undefined; assuming extern returning int c:/mozilla/other-licenses/libical/src/libical/vsnprintf.c(132) : warning C4013: 'sigaction' undefined; assuming extern returning int make[5]: Leaving directory `/cygdrive/c/mozilla/other-licenses/libical/src/libical' make[4]: Leaving directory `/cygdrive/c/mozilla/other-licenses/libical/src' make[3]: Leaving directory `/cygdrive/c/mozilla/other-licenses/libical' make[2]: Leaving directory `/cygdrive/c/mozilla' make[1]: Leaving directory `/cygdrive/c/mozilla'
Do you have edit 1149 to configure.in? http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/configure.in If you're on windows, it shouldn't be building vsnprintf.c
Nope. I don't, probably. Thanks. I just updated the calendar directories - didn't realize there was a build change along with!
Curtis or Colin, if this problem is fixed for you, feel free to mark it as VERIFIED. If not, you should reopen it. If you can't change the bug's status, leave a comment.
Keywords: verifyme
Verified.
Status: RESOLVED → VERIFIED
Keywords: verifyme
QA Contact: gurganbl → libical
Component: libical → Internal Components
The bugspam monkeys have been set free and are feeding on Calendar :: Internal Components. Be afraid for your sanity!
QA Contact: libical → base
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: