All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>,
	david@lang.hm, LKML Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Linux Kernel include files
Date: Wed, 27 Jun 2007 17:40:46 +0200	[thread overview]
Message-ID: <20070627154046.GN1094@stusta.de> (raw)
In-Reply-To: <E27BAC4D-2F1E-4191-A75D-4DD18231C320@mac.com>

On Tue, Jun 26, 2007 at 09:32:39PM -0400, Kyle Moffett wrote:
> On Jun 22, 2007, at 11:00:38, Adrian Bunk wrote:
>> It would certainly help if Joerg would tell what exactly breaks, but I 
>> spot one likely problem in include/asm-i386/types.h:
>>
>> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
>> typedef __signed__ long long __s64;
>> typedef unsigned long long __u64;
>> #endif
>>
>> It might make sense to remove the #if and simply require that a C compiler 
>> under Linux must know about the C99 "long long"?
>
> Gah, this particular topic and a few other similar header-compatibility 
> ones show up once a month on LKML; I should probably just make a patch to 
> fix all the types.h files and be done with it.  The proper solution is 
> this:
>
> # if __STDC_VERSION__ >= 19901L
> typedef   signed long long __s64;
> typedef unsigned long long __u64;
> # elif defined(__GNUC__)
> __extension__ typedef   signed long long __s64;
> __extension__ typedef unsigned long long __u64;
> # else
> #  error "Your compiler doesn't support long long (IOW: It sucks).  Please 
> get a new one"

This part is wrong.

gcc supported "long long" before C99 existed.
And Joerg said the Sun cc supported "long long" before gcc did.

> # endif
>
> That way if you have any kind of vaguely-long-long-compatible compiler then 
> it will work, and otherwise you'll get a nice useful error message.

No, consider a pre-C99 gcc version that supports "long long".

> It 
> also makes sure that GCC doesn't spew warnings/errors when in c89-pedantic 
> mode.  The "__extension__" keyword is designed for use in implementation 
> header files which want to use GCC-isms unconditionally.

That's a good point I missed.

What about:

#if defined(__GNUC__) && __STDC_VERSION__ < 19901L
__extension__ typedef   signed long long __s64;
__extension__ typedef unsigned long long __u64;
#else
typedef   signed long long __s64;
typedef unsigned long long __u64;
#endif

> Cheers,
> Kyle Moffett

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  reply	other threads:[~2007-06-27 15:40 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-21 22:32 Linux Kernel include files Joerg Schilling
2007-06-21 23:25 ` david
2007-06-21 23:38   ` Joerg Schilling
2007-06-22  3:38     ` David Woodhouse
2007-06-22  5:18       ` H. Peter Anvin
2007-06-22 15:00       ` Adrian Bunk
2007-06-26 15:26         ` H. Peter Anvin
2007-06-27  1:32         ` Kyle Moffett
2007-06-27 15:40           ` Adrian Bunk [this message]
2007-06-27 15:52             ` Joerg Schilling
2007-06-27 15:59               ` Robert P. J. Day
2007-06-27 17:32               ` Userspace compiler support of "long long" Adrian Bunk
2007-06-27 22:30                 ` Kyle Moffett
2007-06-27 22:57                   ` Randy Dunlap
2007-06-27 23:16                     ` Randy Dunlap
2007-06-28  2:12                       ` Geert Uytterhoeven
2007-06-28  6:50                         ` Jan Engelhardt
2007-06-28 11:34                           ` Geert Uytterhoeven
2007-06-28 11:36                             ` David Woodhouse
2007-06-28 12:20                               ` Kyle Moffett
2007-06-28  3:06                       ` Kyle McMartin
2007-06-28  0:30                   ` Andi Kleen
2007-06-28 11:42                     ` Kyle Moffett
2007-06-28  3:57                   ` Matthew Wilcox
2007-06-28 11:53                     ` Kyle Moffett
2007-06-28 12:08                       ` Jakub Jelinek
2007-06-28 12:18                         ` Kyle Moffett
2007-06-28  4:03                   ` H. Peter Anvin
2007-06-28 10:26                 ` Harald Arnesen
2007-06-28 10:44                   ` Joerg Schilling
2007-06-28 12:11                   ` Kyle Moffett
2007-06-28 15:31                     ` Mark Brown
2007-06-28  4:02           ` Linux Kernel include files H. Peter Anvin
2007-06-25 15:17       ` Joerg Schilling
2007-06-25 15:27         ` David Woodhouse
2007-06-25 18:04           ` Harald Arnesen
2007-06-25 20:26             ` Joerg Schilling
2007-06-25 20:32               ` David Woodhouse
2007-06-25 21:43               ` Harald Arnesen
2007-06-25 21:48                 ` Harald Arnesen
2007-06-25 21:49                   ` Joerg Schilling
2007-06-25 22:30                     ` Harald Arnesen
2007-06-25 22:42                       ` Joerg Schilling
2007-06-21 23:59   ` Arnd Bergmann
2007-06-25 15:06     ` Joerg Schilling
2007-06-25 16:00       ` david
2007-06-25 14:48   ` Joerg Schilling
2007-06-21 23:47 ` Arjan van de Ven
2007-06-25 14:53   ` Joerg Schilling
2007-06-25 15:26     ` Arjan van de Ven
2007-06-25 15:27       ` Robert P. J. Day
2007-06-25 20:18     ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2007-06-27 13:45 Joerg Schilling
2007-06-27 22:16 ` H. Peter Anvin
2007-06-27 13:58 Joerg Schilling
2007-06-27 16:40 ` Adrian Bunk
2007-06-27 16:41   ` Joerg Schilling
2007-06-27 18:50     ` Arjan van de Ven
2007-06-27 17:18 ` Sam Ravnborg
2007-06-28 10:47   ` Joerg Schilling
2007-06-28 13:49   ` Jan Engelhardt
2007-06-29 12:59     ` David Woodhouse
2007-06-27 14:00 Joerg Schilling
2007-06-27 16:04 ` David Woodhouse
2007-06-28 10:27   ` Joerg Schilling
2007-06-28 10:37     ` David Woodhouse
2007-06-28 10:39       ` Joerg Schilling
2007-06-28 10:57         ` Jan-Benedict Glaw
2007-06-28 16:15           ` Jan Engelhardt
     [not found] <8AGnE-33a-15@gated-at.bofh.it>
     [not found] ` <8AISu-6Qn-31@gated-at.bofh.it>
     [not found]   ` <8AISu-6Qn-29@gated-at.bofh.it>
     [not found]     ` <8AKUp-1wx-41@gated-at.bofh.it>
2007-06-27 22:35       ` Bodo Eggert
2007-06-27 23:07         ` Arjan van de Ven
     [not found] <8AGnE-33a-13@gated-at.bofh.it>
     [not found] ` <8AIfO-63r-29@gated-at.bofh.it>
     [not found]   ` <8AZJA-7BV-3@gated-at.bofh.it>
     [not found]     ` <8AZJA-7BV-1@gated-at.bofh.it>
     [not found]       ` <8AZJQ-7BV-15@gated-at.bofh.it>
     [not found]         ` <8AZTo-7OT-3@gated-at.bofh.it>
     [not found]           ` <8B4T2-7py-37@gated-at.bofh.it>
2007-07-01  9:47             ` Bodo Eggert

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=20070627154046.GN1094@stusta.de \
    --to=bunk@stusta.de \
    --cc=Joerg.Schilling@fokus.fraunhofer.de \
    --cc=david@lang.hm \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.