Re: [brlcad-devel] Bug in or around sh_billboard.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: Christopher S. M. <br...@ma...> - 2011-01-23 14:35:53
|
On Jan 21, 2011, at 8:27 AM, Tom Browder wrote: > cc1: warnings being treated as errors > sh_billboard.c:125:12: error: pointer of type 'void *' used in subtraction > /bin/bash ../../libtool --tag=CC --mode=compile gcc-4.5.1 > -DHAVE_CONFIG_H -I. -I../../include -pedantic -W -Wall -Wundef > -Wfloat-equal -Wshadow -Winline -Wno-long-long -Werror > -I../../src/other/tcl/generic -I../../src/other/tcl/unix > -I/usr/local/include -DBRLCADBUILD=1 -I../../include > -I../../src/other/openNURBS -pipe -fno-strict-aliasing -fno-common > -fexceptions -ggdb3 -D_FORTIFY_SOURCE=2 -pedantic -W -Wall -Wundef > -Wfloat-equal -Wshadow -Winline -Wno-long-long -c -o sh_cloud.lo > sh_cloud.c > > I remember having to fighting that mess years ago porting to gcc but > have since lost the bubble. But Sean can fix it I know. It should be fixed as of r42535 from yesterday. The problem is isolated to the bu_byteoffset() macro in bu.h that attempts to characterize a pointer as an integer memory offset. For most modern platforms, this is merely the pointer value itself. For some platforms, however, it's not and you have to subtract the pointer value from the first possible pointer value. That accounts for pointer addressing that doesn't start from "zero". Anyways, strict building has forced the issue getting addressed. I merely merged what we do for the Intel compiler since it's c99 compliance caught the void* trick years ago. Cheers! Sean |