[Simh] gcc c99 errors in vaxmod_defs.h and vax780_defs.h

HoffmanLabs Info at HoffmanLabs.Com
Mon Jul 21 11:20:52 EDT 2008


Mac OS X 10.5.4 Leopard with Xtools 3.1 (current) with gcc 4.0.1.

This code:

/* Function prototypes for physical memory interface (inlined) */

SIM_INLINE int32 ReadB (uint32 pa);
SIM_INLINE int32 ReadW (uint32 pa);
SIM_INLINE int32 ReadL (uint32 pa);
SIM_INLINE int32 ReadLP (uint32 pa);
SIM_INLINE void WriteB (uint32 pa, int32 val);
SIM_INLINE void WriteW (uint32 pa, int32 val);
SIM_INLINE void WriteL (uint32 pa, int32 val);
...

runs afoul of c99 rules for inline, and gcc 4.0.1 is now (per its 
release notes) now enforcing these rules.

Compilation errors are akin to the following:

VAX/vaxmod_defs.h:455: warning: inline function ‘WriteB’ declared but 
never defined
VAX/vaxmod_defs.h:454: warning: inline function ‘ReadLP’ declared but 
never defined
VAX/vaxmod_defs.h:453: warning: inline function ‘ReadL’ declared but 
never defined
....

I've implemented the following brute-force hack (in vaxmod_defs.h and 
vax780_defs.h) to get the code to build and run, but it's certainly not 
the right fix.

/* Function prototypes for physical memory interface (inlined) */

#ifdef SIM_INLINE
#undef SIM_INLINE
#define SIM_INLINE extern
#endif /* Hoff */
SIM_INLINE int32 ReadB (uint32 pa);
SIM_INLINE int32 ReadW (uint32 pa);
SIM_INLINE int32 ReadL (uint32 pa);
SIM_INLINE int32 ReadLP (uint32 pa);
SIM_INLINE void WriteB (uint32 pa, int32 val);
SIM_INLINE void WriteW (uint32 pa, int32 val);
SIM_INLINE void WriteL (uint32 pa, int32 val);
...


$ gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)

I've a set of Mac OS X build and install directions posted which include 
this detail, and am working on some related pieces.

I've also tweaked the local version of the build slightly as libpcap is 
around.

I don't immediately see any list archives referenced, so this c99-ism 
may be known and discussed elsewhere.






More information about the Simh mailing list