Re: [PATCH] hfsplus: fix warnings in fs/hfsplus/bfind.c: In function 'hfs_find_1st_rec_by_cnid'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 8 Mar 2013 16:15:48 +0300 Vyacheslav Dubeyko <slava@xxxxxxxxxxx> wrote:

> > I don't see that warning.  Whatever gcc you're using appears to be
> > mishandling unreachable().  Please provide details?
> > 
> 
> The warning is reproducible with special kernel configuration (please, see attached configuration file).

# CONFIG_BUG is not set

Erk yes, CONFIG_BUG=n causes a ton of problems.  But in the case of
x86, it should still work OK:

#define BUG()							\
do {								\
	asm volatile("ud2");					\
	unreachable();						\
} while (0)

But the problem is that the above code is dependent upon both
CONFIG_BUG and CONFIG_DEBUG_BUGVERBOSE.  If both these are unset then
we get the stupid implementation, from include/asm-generic/bug.h:

#ifndef HAVE_ARCH_BUG
#define BUG() do {} while(0)
#endif

ie: the kernel silently locks up.

I think it would be better if x86 were to provide the "ud2" version of
BUG() when CONFIG_BUG=n, as well as when CONFIG_DEBUG_BUGVERBOSE=n. 
That would probably generate less code than the daft
include/asm-generic/bug.h implementation anyway.


As for why you got those warnings: gcc bug, IMO.  If the compiler sees

	int x;

	do { } while (0);

	wibbles(x);

then it should have brains to not tell us that x is used-unintialised.
Sigh.

I'm not particularly enthused about fixing CONFIG_BUG=n stuff.  It's a
nuisance.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux