From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075317506426.tru64-unix-managers.marc@archive.invalid> From: gfkpci () borg ! cis ! rit ! edu (Geordie Klueber) Date: Tue, 07 Feb 1995 22:23:47 +0000 To: tru64-unix-managers Subject: SUMMARY: libg++ (2.6.2) problem X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075317506426 About 3 minutes after my posting, a super-nova exploded inside my head and I figured out my problem. For anyone building libg++ (version 2.6.2) on the OSF/1 platform, you'll want to take notice of this solution. In the file libio/iosscanf.c, look at the function header for the _IO_sscanf function. In the argument declaration for the NON-ANSI C case, the type of the "string" argument is NOT defined. As a result, the type defaults to "int", which is 32-bits on the Alpha (and most other architectures). Since the Alpha is a 64-bit machine, the result is that any function calling the _IO_sscanf function is likely to cause a segmentation violation due to the truncation of the pointer to the "string" buffer. In my file, the problem is on line 38. Here's what the code WAS: #ifdef __STDC__ (const char * string, const char* format, ...) #else (string, format, va_alist) char *format; va_dcl #endif ^^^^^^^^^^^^^^^^^^^^ Note that there is no type declaration for the "string" argument. Now, here's what the code SHOULD be: #ifdef __STDC__ (const char * string, const char* format, ...) #else (string, format, va_alist) char *string; char *format; va_dcl #endif Once I made this change, I just recompiled, rebuilt the library and the test programs and all was well. IF YOU MISS THIS FIX, ANYONE USING THE sscanf(3) FUNCTION IS LIKELY TO RUN INTO PROBLEMS! Caveat Emptor... :-) Hope this helps someone else out there... :-) -- Geordie