mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [UPDATE] gcc NULL strings passed from ternary operators in kernel modules
@ 2011-01-13  7:56 Jeffrey Merkey
  2011-01-17  8:50 ` Américo Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffrey Merkey @ 2011-01-13  7:56 UTC (permalink / raw)
  To: linux-kernel

might help if my examples are correct -- geez...

interesting case with gcc.  The following code example:

printk("%s\n", (value & 1) ? "set": "clear");

will evaluate to NULL unless the ":" character has a space after
static string declaration.

this version

printk("%s\n", (value & 1) ? "set" : "clear");

works.

go figure.   Looks like gcc assumes this case is a C++ construct of
some sort and
evaluates it to NULL.

Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-17  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-13  7:56 [UPDATE] gcc NULL strings passed from ternary operators in kernel modules Jeffrey Merkey
2011-01-17  8:50 ` Américo Wang

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

all inboxes | Powered by JetHome®