This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: [PATCH] C undefined behavior fix


Bernard Dautrevaux writes:

> OH... are you saying that the Linux kernel is not writtent in ANSI C? AFAICR

No, in fact the kernel isn't written in ANSI C. :)
If nothing else, the fact that it uses a lot of gcc-specific
extensions rules that out.  And it assumes that you can freely cast
pointers to unsigned longs and back again.  I'm sure others can add to
this list.

> the standard *requires* that the standard library functions have their
> standard meaning. So if the Linux kernel expects them to have some special
> meaning it is *non-conforming* and then you need a *special* compiler,
> understanding this.

Sure the kernel is non-conforming.  "Conforming" means that the
program will run the same on any architecture, and the Linux kernel
surely won't do that - it won't get very far on a PDP-10, I can assure
you. :)

Paul.


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