[OpenBIOS] FYI: If trying to compile openboot source on Solaris ...

Donald R Laster Jr don_sfw at dlaster.com
Thu Oct 31 21:31:54 CET 2013


If one is trying to compile openboot on Solaris using the Solaris C compiler the source code Makefiles' DFLAG settings will need to have "-Xs" added.

The code uses the word "restrict" in a prototype which is an ANSI C99 keyword.

------------------
More details
------------------

  I was checking the options and trying to understand why an error was occuring on a valid prototype line and tried adding -Xt and eventually -Xs to the compiler options.  It looks like it may be a C89/C90 versus C99 issue.

  The compiler default appears to be ANSI C99 mode based upon this from the -flags output

	-Xa   Compile assuming ANSI C conformance, allow K & R extensions (default mode)
	-Xc   Compile assuming strict ANSI C conformance
	-Xs   Compile assuming (pre-ANSI) K & R C style code
	-Xt   Compile assuming K & R conformance, allow ANSI C

and in ./trunk/tools/fscope/fscope.h at line 120 this

	search_t *build_searchlist(extract_t *info, search_t *root, int restrict);

appeared to be causing the error.  When I added -Xs this warning was generated 

	"./fscope.h", line 120: warning: restrict is a keyword in ISO C99

instead of this error

	"./fscope.h", line 120: Non-pointer types cannot be restrict qualified

The word argument "restrict" in the prototype appears to be culprit.  I appear to have gotten a clean build Sun C 5.3.  



More information about the OpenBIOS mailing list