public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 64 bit and __STRICT_ANSI__
@ 2001-11-27 16:09 Kurt Roeckx
  0 siblings, 0 replies; only message in thread
From: Kurt Roeckx @ 2001-11-27 16:09 UTC (permalink / raw)
  To: linux-kernel

Not all places in the kernel headers seem to deal with 64 bit in
the same way.  Their currently seem to be 3 ways it's being
handled.

The first is always define/use it.
The second only if __GNUC__ is defined
And the third only if __GNUC__ is defined and __STRICT_ANSI__ not.

Is there a reason why their should be that __STRICT_ANSI__?

examples:
asm/types.h:
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif
[...]
typedef signed long long s64;
typedef unsigned long long u64;

asm/posix_types.h:
#ifdef __GNUC__
typedef long long       __kernel_loff_t;
#endif

linux/types.h:
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __kernel_loff_t         loff_t;
#endif
[...]
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef         __u64           uint64_t;
typedef         __u64           u_int64_t;
typedef         __s64           int64_t;
#endif

asm/fcntl.h:
struct flock64 {
        short  l_type;
        short  l_whence;
        loff_t l_start;
        loff_t l_len;
        pid_t  l_pid;
};

linux/dirent.h:
struct dirent64 {
        __u64           d_ino;
        __s64           d_off;
        unsigned short  d_reclen;
        unsigned char   d_type;
        char            d_name[256];
};



What they seem to have in common is that __* is defined(__GNUC__)
&& !defined(__STRICT_ANSI__), and the rest not.

The reason I bring this up is because on libc5 including some
header file like <fcntl.h> and <dirent.h> will cause compilation
problems if using -ansi, and I have no idea how to fix it properly.


Kurt


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-27 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-27 16:09 64 bit and __STRICT_ANSI__ Kurt Roeckx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox