buglibiconv - Bugs: bug #51313, Pointer Truncation Warning on...

 
 

bug #51313: Pointer Truncation Warning on Windows 64-bit builds

Submitter:  John <autobyte>
Submitted:  Sun 25 Jun 2017 11:07:52 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Jun 2017 12:34:43 AM UTC, comment #1: 

Thanks for the report.

The warnings come from the use of gperf.
gperf 3.1 is fixed: it no longer produces code that elicits these warnings; see https://savannah.gnu.org/bugs/?45330 .

The libiconv 1.15 release, unfortunately, was made with gperf-3.0.4. But the next libiconv release will use gperf 3.1 or newer.

As a workaround, you can either ignore the warnings, or regenerate said files, through Makefile.devel, assuming you have gperf version 3.1 in your PATH.

Bruno Haible <haible>
Group administrator
Sun 25 Jun 2017 11:07:52 PM UTC, original submission:  

There are quite a few warning when compiling this on 64-bit Windows using either Visual Studio 2015 or 2017 tools. It looks like it stems from the (int)(long) constructs like those used in aliases.h (starting at line 818):

{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, ei_sjis},

Visual Studio 2015 and 2017 are more strict about reporting pointer truncation (even when explicit casting is used). On Windows, type long, is always 32-bits no matter the build type (32 or 64-bit). So when building for Windows 64-bit, the cast to long is truncating a 64 pointer to 32-bits and thus the warning. Clearly, this doesn't really truncate anything based on the construct used. However, it would be nice if the warnings weren't there. To fix, one would need to cast to an integral type that is 64-bit (on Windows) before casting to int.

John <autobyte>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by autobyte (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2018-05-05 haible CategoryNone Build
    2017-06-26 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code