Re: [OT] Compiler warning level
From: Chris Croughton (chris_at_keristor.net)
Date: 11/13/04
- Next message: Malcolm: "Re: Simple vsscanf source code?"
- Previous message: Gordon Burditt: "Re: How does C cope if architecture doesn't address bytes?"
- In reply to: Michael Mair: "Re: [OT] Compiler warning level"
- Next in thread: Michael Mair: "Re: [OT] Compiler warning level"
- Reply: Michael Mair: "Re: [OT] Compiler warning level"
- Reply: Old Wolf: "Re: [OT] Compiler warning level"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 13 Nov 2004 20:11:07 +0000
On Sat, 13 Nov 2004 01:19:18 +0100, Michael Mair
<Michael.Mair@invalid.invalid> wrote:
> Chris Croughton wrote:
>
>> I use -W as well, it catches a few more warning cases (comparing
>> unsigned values as < or <= zero, a < b < c (one it actually caught the
>> other day, I'd deleted too many characters), unused arguments). They
>> aren't essential for ANSI but they can show up errors (or things which
>> need implementing, like using the function arguments).
>
> For -W, you need to know too much. This is an option I tell
> them about but usually the introduction to splint helps them
> more.
True, -W is a bit over the top (but lint is usually far more so, I know
a lot of people who when introduced to lint "shoot the messenger" and
either don't use it of turn off everything they can). The one I do turn
off is the signed/unsigned comparisons, that gets really annoying
(especially with some versions of gcc which complain about constants, I
really do not want to have to write x > 0U).
> Definitely! But I prefer teaching them the language to a point where
> they can appreciate make before introducing them to it.
I use make almost more for other transformations than for compiling.
>> Introduce them to make?
>
> Already happens. ar, make, gprof, cvs and other come in towards the end
> of my course. When they have learned to write complex code which
> justifies it. In the long run, the tools are more important than the
> language used, but most of them do not even know "that computers can
> have command lines" when they enter the course.
Ah, to me that's a given. Computers had nothing but command lines when
I started -- well, OK, unless you count the front panel switches and the
button which loaded the bootstrap from the card reader. I suppose the
lights on the panel could be called a GUI, they were sort of graphical
and it was a user interface of sorts. And the oscilloscope <g>...
> Make is definitely too much for absolute beginners. They first have
> to really understand (by "menial labour" with an actual language at
> "actual" problems) why they need it.
Hmm. I tend to write the makefile before typing in the start of the
program...
> Aliases (as Dan Pop suggested) or this script is quite enough at the
> start.
Pity gcc doesn't take an environment variable for the default options,
so it could be set up in the login scripts. There was something very
elegant about just typing "cc x.c". But I suppose an alias is about as
close...
Chris C
- Next message: Malcolm: "Re: Simple vsscanf source code?"
- Previous message: Gordon Burditt: "Re: How does C cope if architecture doesn't address bytes?"
- In reply to: Michael Mair: "Re: [OT] Compiler warning level"
- Next in thread: Michael Mair: "Re: [OT] Compiler warning level"
- Reply: Michael Mair: "Re: [OT] Compiler warning level"
- Reply: Old Wolf: "Re: [OT] Compiler warning level"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]