[Flac-dev] Compiler warnings using gcc-4.1

Josh Coalson xflac at yahoo.com
Tue Jan 2 13:27:29 PST 2007


--- Erik de Castro Lopo <erikd-flac at mega-nerd.com> wrote:
> Hi Josh et al,
> 
> I'm compiling on an Ubuntu Edgy x86 machine. Edgy comes standard
> with gcc-4.1 and I'm getting a number of warnings:
> 
>    memory.c: In function 'FLAC__memory_alloc_aligned':
>    memory.c:52: warning: cast from pointer to integer of different
> size
>    memory.c:52: warning: cast to pointer from integer of different
> size
> 
>    metadata_iterators.c: In function
> 'read_metadata_block_data_picture_cb_':
>    metadata_iterators.c:2370: warning: dereferencing type-punned
> pointer will 
>    break strict-aliasing rules
> 
>    metadata_object.c: In function 'FLAC__metadata_object_new':
>    metadata_object.c:504: warning: dereferencing type-punned pointer
> will break 
>    strict-aliasing rules
>    metadata_object.c: In function 'FLAC__metadata_object_clone':
>    metadata_object.c:548: warning: dereferencing type-punned pointer
> will break 
>    strict-aliasing rules
>    metadata_object.c:596: warning: dereferencing type-punned pointer
> will break 
>    strict-aliasing rules
>    metadata_object.c: In function
> 'FLAC__metadata_object_picture_set_mime_type':
>    metadata_object.c:1710: warning: dereferencing type-punned pointer
> will break 
>    strict-aliasing rules
> 
>    encode.c:2710: warning: 'limit_channel_mask' defined but not used
> 
>     http.c:433: warning: pointer targets in passing argument 5 of
> 'getsockopt' 
>     differ in signedness
> 
> Are you interested in fixing these? The first and the last are pretty
> easy to fix, but I know from my own code that the "dereferencing
> type-punned pointer" warnings require more intrusive work to fix
them.

yes, I definitely want to fix them all.  the ones from memory.c
are actually "on purpose", but if you know of a more correct and
warning-less way to align pointers that will work for different
pointer widths (I'm sure there must be one) please let me know.

Josh


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Flac-dev mailing list