buggperf - Bugs: bug #45330, Use offsetof instead of cast to...

 
 

bug #45330: Use offsetof instead of cast to long

Submitted by:  None
Submitted on:  Tue 16 Jun 2015 07:43:09 AM UTC  
 
Category: Generated codeSeverity: 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.

 

Sat 26 Nov 2016 01:57:05 AM UTC, comment #1:

Thanks for the report. I'm changing the generated code to do an intermediate cast to 'size_t', not 'long'.

Unfortunately, the generated code cannot use the offsetof macro, because this would change the set of required prerequisite #include statements.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Tue 16 Jun 2015 07:43:09 AM UTC, original submission:

Some compilers (gcc for x64 mingw) warn of casts from a pointer to
a shorter integer, and `long int` is always 32-bit on Windows.

This patch replaces the casts with `offsetof` standard macro whne ANSI-C or C++.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by haible (Updated 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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 26 Nov 2016 01:57:05 AM UTChaibleStatusNone=>Fixed
      Assigned toNone=>haible
      Open/ClosedOpen=>Closed
    Thu 24 Nov 2016 12:09:20 AM UTChaibleCategoryNone=>Generated code
    Tue 16 Jun 2015 07:43:09 AM UTCNoneAttached File-=>Added 0001-Use-offsetof-instead-of-cast-to-long.patch, #34231

    Back to the top


    Powered by Savane 3.1-cleanup1