Skip to contentSkip to conversation

2.4.19 warnings with allnoconfig

DISCUSSION [email protected] 6 participants 6 messages Aug 4, 2002

lore
Share & tools
lore
#0 lore raw

most of those arent really problems, justwasting space, functions defined but not called are not damaging, they might be there for later functionality, but doing that is annoying, and dirtys code, which gives me stress, ;) dm.

On Sun, 04 Aug 2002 13:23:52 +1000 Keith Owens <[email protected]> wrote:

2.4.19 with make allnoconfig produces these warnings. How about getting a clean kernel before starting on 2.4.20?

init/do_mounts.c:980: warning: `crd_load' defined but not used

arch/i386/kernel/setup.c: In function `amd_adv_spec_cache_feature':
arch/i386/kernel/setup.c:751: warning: implicit declaration of function `have_cpuid_p' arch/i386/kernel/setup.c: At top level:
arch/i386/kernel/setup.c:2629: warning: have_cpuid_p' was declared implicitly extern' and later static' arch/i386/kernel/setup.c:751: warning: previous declaration of have_cpuid_p'

arch/i386/kernel/dmi_scan.c:196: warning: `disable_ide_dma' defined but not used

fs/dnotify.c: In function `__inode_dir_notify':
fs/dnotify.c:139: warning: label `out' defined but not used

fs/namespace.c: In function `mnt_init':
fs/namespace.c:1093: warning: implicit declaration of function `init_rootfs'

drivers/char/random.c:540: warning: `free_entropy_store' defined but not used

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 1 line

2.4.19 with make allnoconfig produces these warnings.

Just a hint:
There is almost no software with completely clean code. Whenever you see one compiling and it produces no warnings it's most likely that the build script just suppresses warnings.

see you,
Chris

#2 lore raw
Quoted 6 lines · Christian Neumair
Quoted 1 line

2.4.19 with make allnoconfig produces these warnings.

Just a hint:
There is almost no software with completely clean code. Whenever you see one compiling and it produces no warnings it's most likely that the build script just suppresses warnings.

I completely disagree with you. I try hard to make my programs compile without a warning with -Wall, even if it sometimes makes the code a bit more difficult to read (mainly because of parenthesis and casts). This way, I have fairly reduced portability issues with 32/64 bits, LE/BE machines.

Just a hint :-)
It is always bad to ignore the compiler's complaints, because it tells you that it may do things wrong when it's not sure about what you want.

Spending hours fixing a few warnings in the kernel has already led me to fix some bugs that only a compiler or an attentive human would have detected, specially when indentation fools you. Eg, this common mistake :

	if (something1)
		if (something 2)
			do_2();
	else
		do_not_1();

Cheers,
Willy

#5 lore raw
In reply to Christian Neumair
Quoted 4 lines · Christian Neumair
Quoted 1 line

2.4.19 with make allnoconfig produces these warnings.

Just a hint:
There is almost no software with completely clean code.

I can't agree. What you can say is that if you enable warnings from the beginning, it's much easier because you prevent those warnings, if you get them a couple of times.

If you upgrade your compiler, it can issue new warnings, like you see when using gcc 3.x, or e.g. when changing from 2.8.x to 2.95.x.

Quoted 2 lines

Whenever you see one compiling and it produces no warnings it's most likely that the build script just suppresses warnings.

It can also mean that a software engineer has done a good job ;-) Always look for -Wall as a start when using the gcc compiler.

Quoted 2 lines

see you,
Chris

Best regards,

Aschwin Marsman

--

aYniK Software Solutions         all You need is Knowledge
Bedrijvenpark Twente 305         NL-7602 KL Almelo - the Netherlands
P.O. box 134                     NL-7600 AC Almelo - the Netherlands
telephone: +31 (0)546-581400     fax: +31 (0)546-581401
[email protected]              http://www.aYniK.com
#3 lore raw
In reply to Willy Tarreau

Hi Willy,

Quoted 9 lines · Willy Tarreau

It is always bad to ignore the compiler's complaints, because it tells you that it may do things wrong when it's not sure about what you want. [snip] specially when indentation fools you. Eg, this common mistake :

	if (something1)
		if (something 2)
			do_2();
	else
		do_not_1();

You are quite right. Compilations should be SILENT. How else do you know nothing's wrong? I would rewrite (refactor?) the code above as:

  if( something1 )
  {
    if( something2 ) { do_2(); }
  }
  else
  {
    do_not_1();
  }

and yes I use two spaces, not tabs, to indent, so I don't fall off the page; and yes, I always use the braces, even in a one-liner; and yes, I put the braces there and not like K&R, so I can see the buggers. Also I NULL all my pointers immediately after declaring them AND after using them, and I check they're not NULL before using them, which prevents loads of segfault type errors when I screw up and...

But in trying to change the world, you're wasting time (and bandwidth :).

73,
Ged.

#4 lore raw
Quoted 2 lines

and yes I use two spaces, not tabs, to indent, so I don't fall off the page;

You have other problems in your code than indent too wide then. Seriously.

T.