Wireshark-bugs: [Wireshark-bugs] [Bug 1430] EtherCAT dissector
Date: Mon, 15 Oct 2007 06:25:57 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1430





------- Comment #44 from [email protected]  2007-10-15 06:25 GMT -------
(In reply to comment #43)
> The current dissector fails to compile on Solaris-8-SPARC with:
> packet-ethercat-frame.h:29: warning: #pragma pack(push[, id], <n>) is not
> supported on this target
> packet-ethercat-frame.h:40: warning: #pragma pack(pop[, id], <n>) is not
> supported on this target
> packet-ethercat-frame.c: In function 'dissect_ethercat_frame':
> packet-ethercat-frame.c:101: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> And on OSX-10.4-PPC with:
> cc1: warnings being treated as errors
> packet-nv.c: In function 'dissect_nv':
> packet-nv.c:114: warning: unused variable 'nv_length'
> make[3]: *** [packet-nv.lo] Error 1
> make[3]: *** Waiting for unfinished jobs....
>  gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../..
> -I/Users/buildslave/Documents/wireshark/osx104ppc/install/include
> -I/usr/local/include -I/usr/include
> -DPLUGIN_DIR=\"/Users/buildslave/Documents/wireshark/osx104ppc/install/lib/wireshark/plugins/0.99.7-SVN-23178\"
> -Werror -DINET6 -no-cpp-precomp "-D_U_=__attribute__((unused))" -g -O2 -Wall -W
> -Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign
> -I/usr/local/include -pthreads -I/usr/local/include/gtk-2.0
> -I/usr/local/lib/gtk-2.0/include -I/usr/X11R6/include
> -I/usr/local/include/atk-1.0 -I/usr/local/include/pango-1.0
> -I/usr/X11R6/include/freetype2 -I/usr/local/include/glib-2.0
> -I/usr/local/lib/glib-2.0/include -I/usr/include -c packet-ams.c -MT
> packet-ams.lo -MD -MP -MF .deps/packet-ams.TPlo  -fno-common -DPIC -o
> .libs/packet-ams.o
> powerpc-apple-darwin8-gcc-4.0.1: unrecognized option '-pthreads'
> cc1: warnings being treated as errors
> packet-ams.c: In function 'NetIdFormater':
> packet-ams.c:387: warning: operation on 'offset' may be undefined
> packet-ams.c:387: warning: operation on 'offset' may be undefined
> packet-ams.c:387: warning: operation on 'offset' may be undefined
> packet-ams.c:387: warning: operation on 'offset' may be undefined
> packet-ams.c:387: warning: operation on 'offset' may be undefined
> make[3]: *** [packet-ams.lo] Error 1
> make[2]: *** [all-recursive] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> program finished with exit code 2
> And on Ubuntu-7.01-x86-64 with:
> cc1: warnings being treated as errors
> packet-ethercat-frame.c: In function 'dissect_ethercat_frame':
> packet-ethercat-frame.c:101: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> make[3]: *** [packet-ethercat-frame.lo] Error 1
> make[3]: Leaving directory
> `/media/GeraldsHome/buildbot/bb-wireshark/trunk/ubuntu510x86/build/plugins/ethercat'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory
> `/media/GeraldsHome/buildbot/bb-wireshark/trunk/ubuntu510x86/build/plugins'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/media/GeraldsHome/buildbot/bb-wireshark/trunk/ubuntu510x86/build'
> make: *** [all] Error 2
> program finished with exit code 2
> I'll remove it from the makefiles again.


Unfortunately my build environment does not detect any of these problems, I
would have corrected them otherwise. I will have a look at what I can do to get
rid of the pragma pack usage (completely) and I will remove the declaration of
the unused variable in packet-nv.c.

As I did not see the compilation warning about the unused variable in
packet-nv.c (nv_length) I went looking for options that would make my compiler
(VC2005) would generate these warnings.
As /WX is already defined and this still not detects the unused variable I
tried /analyze instead. This shows that the declaration of the static const
true_false_string flags_set_truth in some of the files hides the declaration in
epan\tfs.h. When removing my own declarations of flags_set_truth, it just wont
compile any longer as flags_set_truth is not defined.
When looking in epan\tfs.h there is a comment for the flags_set_truth that
reads:
 * Old true_false_string from packet.c
 * Retained for backward compatibility until all dissectors are updated.

What is this? What update should be required in *all* dissectors?


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.