[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Problems with PCB



On Thu, 2007-10-25 at 11:13 -0700, Ben Jackson wrote:

> > Warnings file attached below.

Speaking of warnings... when compiling PCB... (Some are serious)

hid/gtk/gui-misc.c: In function ‘loop_key_press_cb’:
hid/gtk/gui-misc.c:305: warning: dereferencing type-punned pointer will break strict-aliasing rules
hid/gtk/gui-output-events.c: In function ‘ghid_port_key_press_cb’:
hid/gtk/gui-output-events.c:411: warning: dereferencing type-punned pointer will break strict-aliasing rules
hid/gtk/gui-output-events.c: In function ‘ghid_port_button_press_cb’:
hid/gtk/gui-output-events.c:536: warning: ‘return’ with no value, in function returning non-void
hid/gtk/gui-output-events.c:542: warning: dereferencing type-punned pointer will break strict-aliasing rules
hid/gtk/gui-output-events.c: In function ‘ghid_port_button_release_cb’:
hid/gtk/gui-output-events.c:640: warning: dereferencing type-punned pointer will break strict-aliasing rules
hid/gtk/gui-output-events.c: In function ‘ghid_port_window_motion_cb’:
hid/gtk/gui-output-events.c:773: warning: dereferencing type-punned pointer will break strict-aliasing rules
hid/gtk/gui-output-events.c: In function ‘ghid_port_window_mouse_scroll_cb’:
hid/gtk/gui-output-events.c:933: warning: dereferencing type-punned pointer will break strict-aliasing rules
hid/gtk/gui-top-window.c: In function ‘ghid_ui_info_append’:
hid/gtk/gui-top-window.c:3651: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘size_t’
hid/nelma/nelma.c: In function ‘nelma_do_export’:
hid/nelma/nelma.c:427: warning: ‘y’ may be used uninitialized in this function
hid/nelma/nelma.c:427: warning: ‘x’ may be used uninitialized in this function
buffer.c: In function ‘FreeRotateElementLowLevel’:
buffer.c:972: warning: passing argument 1 of ‘SetLineBoundingBox’ from incompatible pointer type
autoroute.c: In function ‘ExpandAllEdges’:
autoroute.c:2251: warning: ‘costpoint.X’ may be used uninitialized in this function
autoroute.c:2251: warning: ‘costpoint.Y’ may be used uninitialized in this function
autoroute.c: In function ‘RouteOne’:
autoroute.c:3096: warning: ‘result.route_had_conflicts’ is used uninitialized in this function
misc.c: In function ‘AttachForCopy’:
misc.c:1637: warning: ‘my’ may be used uninitialized in this function
misc.c:1637: warning: ‘mx’ may be used uninitialized in this function
parse_l.c:1495: warning: ‘yyunput’ defined but not used
polygon1.c: In function ‘poly_DelContour’:
polygon1.c:1939: warning: dereferencing type-punned pointer will break strict-aliasing rules
res_lex.c:1143: warning: ‘yyunput’ defined but not used
select.c: In function ‘SelectObjectByName’:
select.c:879: warning: unused variable ‘match’


What is a "type punned pointer", and are we doing anything dangerous
with them?
Is there a portable way to printf a size_t?
Are any of the used uninitialised warnings valid?
We should fix the incorrect pointer type passed to ‘SetLineBoundingBox’.
Can we get rid of some of the unused variable / function warnings?

Sorry to just post rather than get on and fix these myself, but:

  a) I don't know what a type punned pointer is, or why they're
     upsetting the compiler.
  b) I've tried looking at the uninitialised variables before,
     but the code-paths are very complex.
  c) I've got no time to chase the rest anyway!

These warnings were from gcc 4.1.3, if that helps identify why some
aren't seen on other builds.

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user