public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kurt Roeckx <Q@ping.be>
To: linux-kernel@vger.kernel.org
Subject: 64 bit and __STRICT_ANSI__
Date: Tue, 27 Nov 2001 17:09:52 +0100	[thread overview]
Message-ID: <20011127170952.A18621@ping.be> (raw)

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


                 reply	other threads:[~2001-11-27 16:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011127170952.A18621@ping.be \
    --to=q@ping.be \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox