User introduced compiler warning, was Re: Behavior of #error

David Tanguay datangua at watmath.waterloo.edu
Tue Jan 15 21:24:23 AEST 1991


>In article <1192 at van-bc.wimsey.bc.ca> jtc at van-bc.wimsey.bc.ca (J.T. Conklin) writes:
>Has anyone experimented with user-introduced warning messages in C? In
>any other language?  Do they work, or do programmers neglect to use
>them?  Is there a real need for such a feature?

I've been using our compiler's #pragma warning "string" directive lately
for code development, sort of a note book for things that aren't yet
implemented, or should be extended or optimized or whatever. The pragma
causes the compiler to generate a warning message, so I'll see it all the
time during development and not forget that I have to fix something.
It's much less ignorable than
	/* someday we should renooberate the frozbit */
or	/* subcommand BLAH is not yet implemented */
and it is especially noticeable by code inheritors.

I've found it very convenient, but more organised people (i.e., those who
keep notebooks, or have a memory that works) probably don't need it.
It's a nice use for a pragma, though.
-- 
David Tanguay            Software Development Group, University of Waterloo



More information about the Comp.lang.c mailing list