This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> savage[62] make > cc -Aa -D_HPUX_SOURCE -c -O -I. -DNDEBUG attr.c > cpp: "stdsyms.h", line 12: warning 2001: Redefinition of macro _INCLUDE_POSIX_SOURCE. > cc: "/usr/include/stddef.h", line 26: error 1642: Duplicate type specifier "int": ignored. > cc: "/usr/include/stddef.h", line 26: warning 554: Declarator is missing. > *** Error exit code 1 > > I'll try to look into this some more. > > Mary Mary: One way to approach debugging this is to look at the preprocessor output. run cc -Aa -E -DNDEBUG attr.c > attr.i attr.i will have the preprocessor output. Your can look at this an try to see whats going on. In particular, the #line directives in the file will show you whats is being included, in what order. Looking at the system include files may then give you some ideas as to what things to try. There is probably some combination of flags, -D_POSIX_SOURCE or -D_HPUX_SOURCE which will get us something that works. Historically, HP has done some odd things, like turning off POSIX interfaces when you use ANSI "C", so one sees a "pure" ANSI C environment unless other things are turned on manually. Then they have had bugs in their interpretation of the standards. netcdf is written in ANSI C, but uses a few POSIX things like open(), read() and write() in the file ncio.c == posixio.c. The POSIX typedef 'off_t' creeps up from the ncio interface into the netcdf internals. The errors we are seeing might be from a configure problem. If configure is not finding the typedef for 'off_t', it will #define off_t int (or long?). If the system does in fact typedef off_t, then you would get error messages like the ones you are seeing. Similar possibility for ptrdiff_t, which is ANSI, and ssize_t (POSIX?). hope this helps. -glenn