This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using _FILE_OFFSET_BITS=64 with a non-gcc compiler

Bruno Haible <> writes:

|> Here is a patch to that effect. But note that for 'stat', 'statfs', 'statvfs'
|> the #define approach doesn't work:
|>      struct stat buf;
|> would expand to
|>      struct (* (int (*) (const char *, struct stat *)) stat64) buf;
|> which gives a syntax error.
|> Therefore in these cases the 'static inline' approach is used. It is
|> namespace clean but has the slight drawback that &stat is not the
|> same in different compilation units

This will break find.  It uses &stat in different compilation units and
depends (rightly) on its uniqueness.  It's a basic property of function
addresses mandated by ISO C.

|> - but this drawback is already present in <sys/stat.h> when using GNU C.

No, with GNU C this works correctly, &stat resolves to a function in
libc_noshared.a, due to the use of extern inline.


Andreas Schwab                                  "And now for something				completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]