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

 
 

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

Submitted by:  John <autobyte>
Submitted on:  Sun 25 Jun 2017 11:07:52 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 Jun 2017 12:34:43 AM UTChaibleStatusNone=>Fixed
      Assigned toNone=>haible
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1