Bug 64467 - dirent and dirent64 are different when _FILE_OFFSET_BITS=64
dirent and dirent64 are different when _FILE_OFFSET_BITS=64
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-05-05 18:00 EDT by Dimitri Papadopoulos
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-12-15 15:12:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
compile this C++ source file to reproduce (397 bytes, text/plain)
2002-05-05 18:01 EDT, Dimitri Papadopoulos
no flags Details

  None (edit)
Description Dimitri Papadopoulos 2002-05-05 18:00:13 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20010901

Description of problem:
In the large file compilation environment (_FILE_OFFSET_BITS set to 64) "dirent"
and "dirent64" are different types but "dirent" should really be typedef'ed to
"dirent64" so that these are the same type. Because of this minor bug I get
warnings when using the Intel C/C++ compiler:
"foo.cc", line 19: warning #556: a value of type "dirent64 *" cannot be assigned
to an entity of type "dirent *"

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Get an Intel C/C++ compiler. There's a demo version.
2. Compile the attached file foo.cc:
   	icpc -c foo.cc

Actual Results:  The Intel C++ compiler warns that "dirent" and "dirent64" are
different types.

Expected Results:  "dirent" and "dirent64" should be the same type in
<bits/dirent.h> when __USE_FILE_OFFSET64 is defined.

Additional info:

The complete output of the Intel C++ compiler is:

$ icpc -c foo.cc
"foo.cc", line 19: warning #556: a value of type "dirent64 *" cannot be assigned
to an entity of type "dirent *"
        file = readdir(dir);

Comment 1 Dimitri Papadopoulos 2002-05-05 18:01:48 EDT
Created attachment 56406 [details]
compile this C++ source file to reproduce
Comment 2 Jakub Jelinek 2002-05-10 10:25:21 EDT
The problem is that either icc lacks reasonable function redirect, or glibc
doesn't know how to do it for it and thus has to fall back to #define
which has this problem.
If you know how to code <sys/cdefs.h> __REDIRECT macro for icc, feel free
to submit patch...

Note You need to log in before you can comment on or make changes to this bug.