This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: README.Portability
- To: Neil Booth <NeilB at earthling dot net>
- Subject: Re: README.Portability
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Sat, 15 Jul 2000 00:20:18 -0400
- Cc: gcc-patches at gcc dot gnu dot org, Zack Weinberg <zack at wolery dot cumb dot org>, Michael Meissner <meissner at cygnus dot com>, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- References: <E13DI6T-0003kc-00@monkey.rosenet.ne.jp>
On Sat, Jul 15, 2000 at 11:54:57AM +0900, Neil Booth wrote:
> No-one raised an objection, and I guess this comes under
> documentation, so I've committed the patch below.
>
> Thanks to Michael and Zack for their comments, which I've
> incorporated. I wasn't quite sure what you meant in a couple of
> instances Michael (I don't know K+R C), so I've surrounded those by
> double stars for you or someone else to expand on.
>
> Please feel free to add new cases, and update and correct mistakes in
> existing ones.
I have fixed up the two ** comments with:
2000-07-15 Michael Meissner <meissner@redhat.com>
* README.Portability: Update integer suffixes and function
prototype sections.
*** gcc/README.Portability.~1~ Fri Jul 14 23:03:11 2000
--- gcc/README.Portability Sat Jul 15 00:15:17 2000
*************** ansidecl.h for the definitions of the ab
*** 155,160 ****
--- 155,163 ----
#define PARAMS(paramlist) () /* K+R C. */
#define VPARAMS(args) (va_alist) va_dcl
+ One aspect of using K+R style function declarations, is you cannot have
+ arguments whose types are char, short, or float, since without prototypes (ie,
+ K+R rules), these types are promoted to int, int, and double respectively.
Calling functions through pointers to functions
-----------------------------------------------
*************** int is done as an unsigned comparison in
*** 230,239 ****
promotes to unsigned) while it is signed in ISO (since all of the
values in unsigned char fit in an int, it promotes to int).
- ** Not having any argument whose type is a short type (char, short,
- float of any flavor) and subject to promotion. **
-
-
Trigraphs
---------
--- 233,238 ----
*************** them.
*** 245,251 ****
Suffixes on Integer Constants
-----------------------------
! **Using a 'u' suffix on integer constants.**
Common Coding Pitfalls
--- 244,254 ----
Suffixes on Integer Constants
-----------------------------
! K+R C did not accept a 'u' suffix on integer constants. If you want to declare
! a constant to be be unsigned, you must use an explicit cast.
!
! You should never use a 'l' suffix on integer constants ('L' is fine), since it
! can easily be confused with the number '1'.
Common Coding Pitfalls
--
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482