monotone

Issue 181: warning: dereferencing type-punned pointer will break strict-aliasing rules

Reported by Peter Volkov, Sep 5, 2011

During monotone-1.0 build gcc reports following warnings:

src/commands.cc:450:57: warning: dereferencing type-punned pointer 
will break strict-aliasing rules
src/commands.cc:460:88: warning: dereferencing type-punned pointer 
will break strict-aliasing rules
src/automate.cc:2426:53: warning: dereferencing type-punned pointer 
will break strict-aliasing rules
src/automate.cc:2441:73: warning: dereferencing type-punned pointer 
will break strict-aliasing rules


This may compile fine but exhibit random runtime failures.

Comment 1 by Richard Levitte, Sep 12, 2011

It boils down to the use of CMD_REF.  The way it's used in those 
places is probably ill advised, would there be a better way?  Maybe 
a CMD_REF2 that doesn't cast to commands::command*...

Created: 4 years 9 months ago by Peter Volkov

Updated: 4 years 9 months ago

Status: New

Followed by: 1 person

Labels:
Type:Defect
Priority:Medium

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status