Opened 17 years ago

Closed 9 years ago

#1741 closed defect (fixed)

[PATCH] Fixes compilation with -Wall -Werror

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: warnings
Cc: warmerdam, Mateusz Łoskot, Kurt Schwehr

Description

Most fixes are to suppress "warning: dereferencing type-punned pointer will break strict-aliasing rules", which is not always easy to do in an elegant way. One big change (in term of diff) is for frmts/aigrid/aigccitt.c where 3 arrays of structure elements missed a lot of braces.

Apart from cosmetic and boring changes, I think that I've catched a bug in the process. See :

Index: frmts/fit/fitdataset.cpp
===================================================================
--- frmts/fit/fitdataset.cpp    (révision 11867)
+++ frmts/fit/fitdataset.cpp    (copie de travail)
@@ -941,7 +941,7 @@
         CPLDebug("FIT", "Loading file with header version 01");

         // map old style header into new header structure
-       FIThead01* head01 = (FIThead01*)&head;
+       FIThead01* head01 = (FIThead01*)head;
         gst_swapb(head->dataOffset);
        info->dataOffset = head01->dataOffset;

Attachments (1)

gdal_svn_suppress_warnings.patch (203.7 KB ) - added by Even Rouault 17 years ago.

Download all attachments as: .zip

Change History (14)

by Even Rouault, 17 years ago

comment:1 by Even Rouault, 17 years ago

Version: unspecifiedsvn-trunk

comment:2 by warmerdam, 17 years ago

Cc: warmerdam added
Component: defaultGDAL_Raster
Keywords: warnings added
Milestone: 1.5.0
Owner: changed from warmerdam to Even Rouault

Even, please go ahead and apply.

Thanks

comment:3 by Even Rouault, 17 years ago

Commited in trunk in r11896

comment:4 by warmerdam, 17 years ago

Doh! I thought the patch only included the fitdataset.cpp change.

The changes in the various support libraries (eg. libtiff, libgeotiff, avc*) are not appropriate and should be backed out.

comment:5 by Even Rouault, 17 years ago

Sorry for the misunderstanding. I'm going to revert.

comment:6 by Even Rouault, 17 years ago

In r11897, revert all unintended changes made in r11896. Just keep the fitdataset.cpp change.

comment:7 by warmerdam, 17 years ago

I have applied the aigccitt.c patch as well (r11903).

comment:8 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added

comment:9 by warmerdam, 16 years ago

Milestone: 1.5.01.6.0

It's too late to try and fix type punning warnings in 1.5.

comment:10 by hobu, 15 years ago

Milestone: 1.6.11.7.0

Kicking this forward. If it is now just a bug for holding type punned warning fixes, maybe it should be closed and a new one created?

comment:11 by Even Rouault, 14 years ago

Milestone: 1.7.0

Untargetting

comment:12 by Even Rouault, 9 years ago

Cc: Kurt Schwehr added

Probably completely out dated but cc'ing Kurt in case he wants to extract stuff from that

comment:13 by Jukka Rahkonen, 9 years ago

Resolution: fixed
Status: newclosed

Must be completely outdated now 7 years later and Kurt have had enough time to consider what to do.

Note: See TracTickets for help on using tickets.