From: Jeffrey A Law <law@cygnus.com>
To: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
Cc: egcs@cygnus.com, wilson@cygnus.com
Subject: Re: system.h & warnings
Date: Sat, 04 Apr 1998 11:01:00 -0000 [thread overview]
Message-ID: <3740.891547768@hurl.cygnus.com> (raw)
In-Reply-To: <199804021620.LAA18789@caip.rutgers.edu>
In message < 199804021620.LAA18789@caip.rutgers.edu >you write:
> One thing I'd like to bring up, the test you used in genoutput.c
> to see if __attribute__ should be used only checks __GNUC__. This can
> fail for stage1 compilers which are gcc but are older versions. E.g.
> these can be either gcc installed by the user or the default compiler
> (like maybe nextstep? I'll bet it fails there.)
Good point.
> I'd like to put something in gansidecl.h to do a rigorous test
> once. Then one can use __attribute__, or macros based on it, more freely.
Yes, I think putting this into gansidecl.h would be fine.
However, I don't want to go littering too much of the source code
with attributes. I don't mind in the generated files because we
very rarely have to look at them :-)
> Should I make a patch to put the following in gansidecl.h?
>
> --Kaveh
>
> > #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
> > # define __attribute__(x)
> > #endif
> >
> > #define ATTRIBUTE_UNUSED __attribute__ ((unused))
> >
> > #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)
> ))
> > #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
> > #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
> > #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
Why bother with the ATTRIBUTE_UNUSED macro? It isn't significantly
simpler or easier to read than __attribute__ ((unused)).
jeff
next prev parent reply other threads:[~1998-04-04 11:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-04-02 8:21 Kaveh R. Ghazi
1998-04-04 11:01 ` Jeffrey A Law [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-04-01 22:44 Jeffrey A Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3740.891547768@hurl.cygnus.com \
--to=law@cygnus.com \
--cc=egcs@cygnus.com \
--cc=ghazi@caip.rutgers.edu \
--cc=wilson@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).