Skip to contentSkip to conversation

x86 BUG bug

DISCUSSION Jeff Garzik 3 participants 3 messages Oct 1, 2006

lore
Share & tools
lore
#0 lore raw

I have a couple ATA drivers that spit out "foo might be used uninitialized" warnings. Rather than the usual gcc nonsense, it turns out that the code follows this pattern:

	type_t foo;

	if (condition 1)
		foo = x;
	else if (condition 2)
		foo = y;
	else
		BUG();

It doesn't warn on other platforms, so I dug into the BUG() code on x86, and discovered that it is missing the 'noreturn' attribute found in other BUG() definitions.

Being rusty on the gcc asm syntax -- does an inline asm statement permit 'noreturn'? -- I figured it would be best just to report this, rather than create a patch myself.

Jeff

#1 lore raw
Quoted 5 lines

Being rusty on the gcc asm syntax -- does an inline asm statement permit 'noreturn'? -- I figured it would be best just to report this, rather than create a patch myself.

It doesn't AFAIK. It might be possible with an inline function though with a wrapper macro for __FUNCTION__

-Andi

#2 lore raw
In reply to Jeff Garzik
Quoted 1 line · Jeff Garzik

Being rusty on the gcc asm syntax -- does an inline asm statement permit 'noreturn'? -- I figured it would be best just to report this, rather than create a patch myself.

I'm reworking BUG at the moment, and I noticed this as well. I'll try to fix it.

J