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

Submitter:  Jaroslav Škarvada <yarda>
Submitted:  Thu 19 Jul 2012 02:27:47 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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>
Group 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>

 

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

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
  • -email is unavailable- added by eggert (Updated the item)
  • -email is unavailable- added by yarda (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.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-19 eggert Attached File- Added grep-patch.txt, #26227
        StatusNone Fixed
        Open/ClosedOpen Closed
    2012-07-19 yarda Attached File- Added patch.patch, #26223

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code