This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Anything like #pragma warn "my message" in GCC?
- From: Mark Minich <mminich at tellabs dot com>
- To: Falk Hueffner <hueffner at informatik dot uni-tuebingen dot de>, Eljay Love-Jensen <eljay at adobe dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 18 Jun 2004 14:14:16 -0500
- Subject: Re: Anything like #pragma warn "my message" in GCC?
- References: <87hdt8n88d.fsf@informatik.uni-tuebingen.de>
Thanks, guys!
I hadn't tried #error, since I didn't actually want to
cause an error. But #warning works, thanks so much!
-Mark
Eljay Love-Jensen wrote:
>
> For GCC (at least, GCC 3.3.1):
>
> #warning "This is a warning"
>
> #error "This is an error"
>
> I'm not 100% sure, but I think #warning is an extension. And #error is in
> the standard.
>
> For an "info" you may want to use this convention:
>
> #warning "INFO: this is informative"
>
> HTH,
> --Eljay
Falk Hueffner wrote:
>
> Mark Minich <mminich@tellabs.com> writes:
>
> > In some other compilers, I can output a message, warning,
> > or error from the preprocessor with one of the following
> > directives (which vary from one compiler to another):
> >
> > #info "my message"
> > #warn "my message"
> > #error "my message"
> >
> > or
> >
> > #pragma info "my message"
> > #pragma warn "my message"
> > #pragma error "my message"
> >
> > ...or other similar syntax.
> >
> > I tried various combinations of these, and I looked in the
> > online GNU manual under pragmas and preprocessor directives,
> > but I found nothing like these.
>
> That's weird. #error works and needs to, because the standard mandates
> it. gcc also has #warning.
>
> --
> Falk
Eljay Love-Jensen wrote:
>
> For GCC (at least, GCC 3.3.1):
>
> #warning "This is a warning"
>
> #error "This is an error"
>
> I'm not 100% sure, but I think #warning is an extension. And #error is in
> the standard.
>
> For an "info" you may want to use this convention:
>
> #warning "INFO: this is informative"
>
> HTH,
> --Eljay
-----------------------------------------
============================================================
The information contained in this message may be privileged
and confidential and protected from disclosure. If the
reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to
the intended recipient, you are hereby notified that any
reproduction, dissemination or distribution of this
communication is strictly prohibited. If you have received
this communication in error, please notify us immediately by
replying to the message and deleting it from your computer.
Thank you.
Tellabs
============================================================