[cfe-dev] #error and #warning: why include "#error/#warning" in the diagnostic?

Dmitri Gribenko gribozavr at gmail.com
Tue Jan 31 12:29:14 PST 2012


On Tue, Jan 31, 2012 at 10:17 PM, Ted Kremenek <kremenek at apple.com> wrote:
> I received some feedback from some users who wondered why #error/#warning diagnostics include the actual "#error" in the diagnostic, e.g.:
>
>  t.c:1:2: error: #error this is an error
>
> This seems redundant.  Is this necessary?

It marks explicitly diagnostics that come from source code (as opposed
to diagnostics coming from the compiler).

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the cfe-dev mailing list