Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: gcc failure (optimised/non-optimised) Date: Mon, 01 May 2017 11:34:20 -0700 Organization: None to speak of Lines: 68 Message-ID: References: <58fb2265.5246218@news.xs4all.nl> <959d5007-8ac8-42f9-a6d9-b5e23feda0de@googlegroups.com> <36d67442-8861-41b5-b5b3-f71681740e59@googlegroups.com> <935683a9-7c2e-4f71-adcc-998d8a7fe0b4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="40ab068b728f196ddeb1bab8be39060a"; logging-data="10776"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mzlxWZB2XOC4maMRt29iT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Gxio06o72rTZvihSV+XlelSNw+E= sha1:FY5pxeUHZm2FeENwRg+kJXE5EJU= Xref: csiph.com comp.lang.c:108920 David Kleinecke writes: > On Monday, May 1, 2017 at 7:27:33 AM UTC-7, David Brown wrote: >> On 01/05/17 00:33, David Kleinecke wrote: >> > On Sunday, April 30, 2017 at 12:18:23 PM UTC-7, David Brown wrote: >> >> So sometimes you use Int to mean "signed int", and sometimes you use it >> >> to mean "unsigned int". I thought it would be hard to come up with a >> >> worse idea than using "Int" for "unsigned int" - but it seems I >> >> underestimated you! >> >> >> >> If a type has a standard name, use it. If you have some serious >> >> aversion to writing bool, long, etc., then at the very least make sure >> >> that Bool, Long, etc., are defined exactly as the normal lower case >> >> versions. >> > >> > The kind of code I read and write rather rarely has any simple >> > types other than Bool and Void. Most of the types are typedefs >> > of structs. >> > ty >> >> It's fine to give your own types your own names. All I am saying is >> don't give existing standard types new names that are confusing or >> pointless, and don't pick names that are confusingly like existing >> standard types. > > I agree with that in general but we may differ in detail. I > include > typedef signed int Int; > typedef unsigned int Unt; > typedef void Void; > in order to start all type names with a capital. I find the > convention of starting type name with a capital helpful - I > suspect other people may deplore it. De gustibus. You can do that if you like. I don't like it, but you're not required to conform to my personal taste. (If I were to do something like that, I'd find "Uint" much clearer than "Unt".) > But I am not an admirer of the built-in C type system. I would > prefer something along the lines of > U0 : unsigned char > S0 : signed char > U1 : unsigned 16-bits > S1 : signed 16-bits > U2 : unsigned 32-bits > U3 : unsigned 64-bits > U4 : unsigned 128-bits > etc. > and other names for things like 48-bit types. You can do that too if you insist. What I strongly object to is your suggestion of defining a type "Int" as an alias for "unsigned int". That would be utterly misleading to any reader who's familiar with C. > I know there are other versions of this stuff. Most of the > others are hideous. I usually prefer to accept the language as it is rather than using tricks to transform it into a style I prefer. Such tricks require the reader to understand both the underlying language and the dialect you've invented. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"