On 09/29/2010 03:12 PM, David C. Rankin wrote:
On 09/28/2010 11:49 PM, Andreas Jaeger wrote:
Mark it extern in the header and add it in only one file with the names, Andreas
Thanks Andreas,
That where I was confused. I read the extern part of the gnu c manual at least 3 times and still couldn't get it sorted. I'll give it another go. This is what confused me more:
http://gcc.gnu.org/gcc-4.3/porting_to.html
Since I'm using the -std=c99 flag for strtof, that put me within the caveat:
"When compiling with -std=c99 or -std=gnu99, the extern inline keywords changes meaning. GCC 4.3 conforms to the ISO C99 specification, where extern inline is very different thing than the GNU extern inline extension. "
Which is where my confusion stemmed from. I'll play with it a little later. I'm 3 hours post-op and I'm going back to bed :p
Thanks.
The solution was found here: http://www.linuxforums.org/forum/programming-scripting/133145-warning-define... and was to 'declare' shape_names using extern in atm_fn.h (and don't assign it in .h): extern const char *shape_names[]; and then define it (i.e. without using extern) in exactly one .c file (atm_fn.c): const char *shape_names[] = {"c172", "airfoil", "sphere_smooth", "sphere_rough", "cone", "cube45", "cyl_long", "airfoil_2", "cube", "cyl_short", "human", "plate_flat_3d", "plate_flat_2d" }; -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org