if searching the "__sparc" (or __amd64 or __i386) in uts/common, you will get 
about 500 entries like  #if defined (__sparc), #ifndef __sparc. In other common 
folders that should contain only arch-indepdendent sources, the same situation 
exists. e.g. in 
http://cvs.opensolaris.org/source/xref/on/usr/src/psm/stand/boot/common/readfile.c

I guess most of those macros are added when porting the sparc version to 
i386/amd64 version or later patching. this is ok for two architectures. but I 
consider this as a serious portablity issue and may result an messed and 
undebuggable code base if we do the same (using many defined(__powerpc) in 
uts/common. feel free to shoot me if I am wrong :).  if it is true, it will 
great impact the ppc porting. auditing and re-engineering of the code base may 
be required to make solaris more portable. also after googling it, it seems 
that no discussions has been around the solaris portabitlity issue ever. any 
comments?

I remember there is one article about why and how linux tries to avoid the use 
of "if defined". I googled it and didnot find it, can sombody point to it?

Just my humble thoughts!
Noah
 
 
This message posted from opensolaris.org

Reply via email to