From: Larry D. <ldo...@re...> - 2008-01-23 05:28:18
|
Steve - On Tue, Jan 22, 2008 at 05:52:32PM -0800, Stephen Williams wrote: > Larry Doolittle wrote: > > ../../verilog-0.9/vvp/vpi_scope.cc:390: warning: dereferencing type-punned pointer will break strict-aliasing rules > > This one is an unfortunate consequence of the compile_vpi_lookup > function. This function take a pointer to a handle so that it > can look up the label and arrange for the matching handle to be > stored in the pointer, some time in the future. > > One way to handle this might be to rewire the vpi objects to > use __vpiHandle as a virtual base class so that C++ dynamic > casting, which is run-time type-safe, can be used here. That would > be a valuable cleanup, but a non-trivial task. The intriguing thing is that gcc-4.3 no longer considers the construct to merit a warning. So I wouldn't worry about it much. The lower hanging fruit, that does apply to both gcc-4.2 and gcc-4.3, is ../../verilog-0.9/vvp/vpi_priv.cc:121: warning: deprecated conversion from string constant to 'char*' > > ../../verilog-0.9/libveriuser/getp.c:56: warning: cast from pointer to integer of different size > The getp.c warning is an unfortunate consequence of the rather > amateurish design of the types in the PLI. Right, and to me it makes perfect sense to keep the warning around, rather than paper over the problem. At least until the standards committee fixes the bug in their standard. - Larry |