Re: linux-next: build warning in Linus'tree

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Wednesday, May 26, 2010 - 9:46 am

On Wed, 26 May 2010, Joakim Tjernlund wrote:

Umm. Except when it doesn't (yes, Linux has the "Wundefined" thing, and 
has had for a long time). I've seen the glibc model do the wrong thing 
exactly because traditional C semantics is "undefined symbol is 0 in 
evaluations"

Try compiling this

	#include <stdio.h>

	#if NOT_HERE == NOT_THERE
	int main()
	{
		printf("Hello world!\n");
	}
	#endif

and even with -Wall it compiles perfectly happily.

So no. The glibc model is _not_ any better in practice.


Which is annoying, I agree. But you shouldn't generally use kernel headers 
for user space anyway, much less export anything that is byteorder- 
specific. So anybody who has this problem is likely doing something iffy 
to begin with.

Besides, you can solve it cleanly by simply avoiding the crazy glibc 
semantics entirely. IOW, the CONFIG_BIG_ENDIAN option I suggested (and 
again, you should damn well not export things that depend on it to user 
space - there are architectures where user-space might be switchable)

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
linux-next: build warning in Linus'tree, Stephen Rothwell, (Tue May 25, 6:05 pm)
Re: linux-next: build warning in Linus'tree, Andrew Morton, (Tue May 25, 6:20 pm)
Re: linux-next: build warning in Linus'tree, Stephen Rothwell, (Tue May 25, 9:09 pm)
Re: linux-next: build warning in Linus'tree, Joakim Tjernlund, (Tue May 25, 11:29 pm)
Re: linux-next: build warning in Linus'tree, Andrew Morton, (Tue May 25, 11:41 pm)
Re: linux-next: build warning in Linus'tree, Stephen Rothwell, (Wed May 26, 12:14 am)
Re: linux-next: build warning in Linus'tree, Joakim Tjernlund, (Wed May 26, 3:21 am)
Re: linux-next: build warning in Linus'tree, Linus Torvalds, (Wed May 26, 8:26 am)
Re: linux-next: build warning in Linus'tree, Linus Torvalds, (Wed May 26, 8:29 am)
Re: linux-next: build warning in Linus'tree, Linus Torvalds, (Wed May 26, 8:33 am)
Re: linux-next: build warning in Linus'tree, Joakim Tjernlund, (Wed May 26, 9:35 am)
Re: linux-next: build warning in Linus'tree, Linus Torvalds, (Wed May 26, 9:46 am)
Re: linux-next: build warning in Linus'tree, Joakim Tjernlund, (Wed May 26, 10:31 am)
Re: linux-next: build warning in Linus'tree, Linus Torvalds, (Wed May 26, 10:45 am)