buggrep - Bugs: bug #36883, ptrdiff_t / size_t mixture

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #36883: ptrdiff_t / size_t mixture

Submitted by:  Jaroslav Škarvada <yarda>
Submitted on:  Thu 19 Jul 2012 02:27:47 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Thu 19 Jul 2012 09:08:46 PM UTC, comment #1:

Thanks for reporting the problem. This is a bug on s390 and any other platform where ptrdiff_t and size_t have different representations for nonnegative values. I installed the attached patch into the 'grep' trunk.

There could still be a problem on the s390 if a buffer gets larger than 2 GiB, since that will exceed what ptrdiff_t can represent. Fixing this will be trickier, though, as we'd have to make sure we never allocate an array with more than PTRDIFF_MAX bytes. That is a different bug, though, so I'll close the current bug report.

(file #26227)

Paul Eggert <eggert>
Project Member
Thu 19 Jul 2012 02:27:47 PM UTC, original submission:

dfasearch.c: In function 'EGexecute':
dfasearch.c:416:3: warning: pointer targets in passing argument 3 of 'mb_case_map_apply' differ in signedness [-Wpointer-sign]
In file included from dfasearch.c:23:0:
search.h:66:1: note: expected 'size_t ' but argument is of type 'ptrdiff_t '

It may cause problems. I noticed probably not directly related problem on RHEL-6 @ s390 ("turkish w/wo dot tests" failure), but probably gcc bug in this case:
https://bugzilla.redhat.com/show_bug.cgi?id=841598

Jaroslav Škarvada <yarda>

 

Attached Files
file #26227:  grep-patch.txt added by eggert (2KiB - text/plain - Patch to fix ptrdiff_t / size_t mismatch.)
file #26223:  patch.patch added by yarda (1KiB - text/x-patch - Patch to suppress warning)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by eggert (Updated the item)
  • -unavailable- added by yarda (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 19 Jul 2012 09:08:46 PM UTCeggertAttached File-=>Added grep-patch.txt, #26227
      StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 19 Jul 2012 02:27:47 PM UTCyardaAttached File-=>Added patch.patch, #26223

    Back to the top


    Powered by Savane 3.1-cleanup1