Newsgroups: comp.lang.c Path: utzoo!utgpu!watserv1!watmath!datangua From: datangua@watmath.waterloo.edu (David Tanguay) Subject: User introduced compiler warning, was Re: Behavior of #error Organization: University of Waterloo Date: Tue, 15 Jan 91 10:24:23 GMT Message-ID: <1991Jan15.102423.12793@watmath.waterloo.edu> Keywords: #pragma warning References: <1192@van-bc.wimsey.bc.ca> Lines: 20 >In article <1192@van-bc.wimsey.bc.ca> jtc@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