Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #109843

Re: Printing like palindrome

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Printing like palindrome
Date Fri, 12 May 2017 08:49:23 -0700
Organization None to speak of
Lines 26
Message-ID <lnziei5b3w.fsf@kst-u.example.com> (permalink)
References <5911a0f4$0$294$14726298@news.sunsite.dk> <p093hc1ll75lunca1bsh8k9ahd7efpvduq@4ax.com> <59156253$0$298$14726298@news.sunsite.dk>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="2da6e6b2a541d2172fa4d68cd264302d"; logging-data="25137"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nFwEEx1G6t7oLY99CO7RZ"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:vUJBsp9GNpECcwegUR8pXKbshQ8= sha1:bKKzsqtByMQpW5hd3Z8jpCbSYrM=
Xref csiph.com comp.lang.c:109843

Show key headers only | View raw


arnuld <sunrise@invalid.address> writes:
> On Tue, 09 May 2017 04:26:17 -0700, Barry Schwarz wrote:
[...]
>> Why all the extra parentheses?  Only one set is required.  Even if you
>> parenthesize the operands of && for reading clarity, there is still one
>> extra set.
>
> GCC complains if I don't put extra set of parenthesis. I did not wantany 
> warning on my face 

The original test was:

    if( ((temp >= 'A') && (temp <= 'Z')) )

If I change it to:

    if (temp >= 'A' && temp <= 'Z') return 1;

I don't get any warnings with "gcc -Wall -Wextra" (and I find it
easier to read).

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
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"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Printing like palindrome arnuld <sunrise@invalid.address> - 2017-05-09 10:59 +0000
  Re: Printing like palindrome Barry Schwarz <schwarzb@dqel.com> - 2017-05-09 04:26 -0700
    Re: Printing like palindrome Robert Wessel <robertwessel2@yahoo.com> - 2017-05-09 14:10 -0500
      Re: Printing like palindrome Keith Thompson <kst-u@mib.org> - 2017-05-09 12:33 -0700
        Re: Printing like palindrome Richard Heathfield <rjh@cpax.org.uk> - 2017-05-09 23:05 +0100
          Re: Printing like palindrome raltbos@xs4all.nl (Richard Bos) - 2017-05-10 10:25 +0000
            Re: Printing like palindrome Richard Heathfield <rjh@cpax.org.uk> - 2017-05-10 11:44 +0100
          Re: Printing like palindrome Keith Thompson <kst-u@mib.org> - 2017-05-10 09:48 -0700
            Re: Printing like palindrome Gareth Owen <gwowen@gmail.com> - 2017-05-10 18:59 +0100
        Re: Printing like palindrome arnuld <sunrise@invalid.address> - 2017-05-12 07:14 +0000
      Re: Printing like palindrome arnuld <sunrise@invalid.address> - 2017-05-12 07:44 +0000
    Re: Printing like palindrome arnuld <sunrise@invalid.address> - 2017-05-12 07:20 +0000
      Re: Printing like palindrome Keith Thompson <kst-u@mib.org> - 2017-05-12 08:49 -0700
        Re: Printing like palindrome arnuld <sunrise@invalid.address> - 2017-05-14 02:01 +0000
  Re: Printing like palindrome mark.bluemel@gmail.com - 2017-05-09 07:13 -0700
    Re: Printing like palindrome scott@slp53.sl.home (Scott Lurndal) - 2017-05-09 14:59 +0000
      Re: Printing like palindrome Keith Thompson <kst-u@mib.org> - 2017-05-09 08:27 -0700
      Re: Printing like palindrome Barry Schwarz <schwarzb@dqel.com> - 2017-05-09 10:40 -0700
  Re: Printing like palindrome scott@slp53.sl.home (Scott Lurndal) - 2017-05-09 14:38 +0000
    Re: Printing like palindrome Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-09 22:48 +0100
      Re: Printing like palindrome scott@slp53.sl.home (Scott Lurndal) - 2017-05-10 13:21 +0000
        Re: Printing like palindrome Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-10 15:45 +0100
        Re: Printing like palindrome Barry Schwarz <schwarzb@dqel.com> - 2017-05-10 10:26 -0700
  Re: Printing like palindrome bartc <bc@freeuk.com> - 2017-05-09 21:28 +0100
    Re: Printing like palindrome raltbos@xs4all.nl (Richard Bos) - 2017-05-10 10:27 +0000
    Re: Printing like palindrome Chad <cdalten@gmail.com> - 2017-05-10 10:39 -0700
  Re: Printing like palindrome bartc <bc@freeuk.com> - 2017-05-10 12:54 +0100
  Printing like palindrome asetofsymbols@gmail.com - 2017-05-12 02:32 -0700

csiph-web