Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 22661: /trunk/ /trunk/aclocal-fallba
From: Jaap Keuter <[email protected]>
Date: Tue, 28 Aug 2007 07:59:32 +0200
Hi,

Included remarks inline....

Thanx,
Jaap

Luis EG Ontanon wrote:
If you try to compile packet-user_encap.c do you get the same error
Yes, same warning. Doesn't stop the build since it's not a 'clean' 
dissector.
and epan/dfilter/dfilter-macro.c  what happens with that?
No warnings here. Maybe because of the big struct.

can you try
	void** sm = &(smi_modules);
and then passing sm to uat_new()
This way it gives "initialization from incompatible pointer type". 
Adding the (void **) typecast moves the problem to the assignment.
or cast it to (void*) instead of (void**)
Hmm tries that before, but aborted during startup due to an assert
in uat_new. It asserts data_ptr != NULL;
The current revision 22697 works though. :)

or passing
&((void*)smi_modules)
Nhaa, that gives "invalid lvalue in unary '&'".


So I've checked in the (void *) variant. Now we'll have to see if this thing flies.
Thanx,
Jaap

On 8/27/07, Jaap Keuter <[email protected]xxx> wrote:
Hi,

Sorry, no luck :-(

Thanx,
Jaap


Luis EG Ontanon wrote:
I got it... Optimizer is smart enough to reduce struct smi_module_t {
char* name; } into char* but not insightfull enought to knwo it did it
itself.

if you change (in line 179)

typedef struct smi_module_t {
      char* name;
} smi_module_t;

to

typedef struct smi_module_t {
         void* dummy;
      char* name;
} smi_module_t;


Is the warning gone?

Luis


On 8/27/07, Jaap Keuter <[email protected]> wrote:
Hi,

My build breaks on oids.c

cc1: warnings being treated as errors
oids.c: In function 'register_mibs':
oids.c:464: warning: dereferencing type-punned pointer will break
strict-aliasing rules
oids.c:476: warning: dereferencing type-punned pointer will break
strict-aliasing rules
make[1]: *** [libwireshark_la-oids.lo] Error 1
make[1]: Leaving directory `/home/jaap/src/wireshark/trunk/epan'
make: *** [all-recursive] Error 1

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)

If I follow the tip on
http://publib.boulder.ibm.com/infocenter/tpfhelp/current/index.jsp?topic=/com.ibm.ztpf-ztpfdf.doc_put.cur/gtpm1/m1rhpun.html
but uat_new() isn't happy with that.

Thanx,
Jaap

Luis EG Ontanon wrote:
This changes the configure scripits, you folks need to:
make mantainerclean
sh ./autogen.sh
./configure
make