Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #153902
| From | Poprocks <please@replytogroup.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: max of 3 |
| Date | 2020-08-22 17:33 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrnrk33oi.c5o.please@logancomp.rathbonelaw.com> (permalink) |
| References | (2 earlier) <Zn60H.1387423$rLg.1259802@fx49.ams4> <4e0bd5c4-6cf2-4ed2-993b-9df9801296ean@googlegroups.com> <rhr89t$q28$1@dont-email.me> <slrnrk2rm3.c5o.please@logancomp.rathbonelaw.com> <rhs0pf$er7$1@dont-email.me> |
On 2020-08-22, David Brown wrote:
> On 22/08/2020 21:15, Poprocks wrote:
>> Why do you recommend optimization options for code that is primarily for
>> testing and debugging purposes?
>
> The compiler can give more useful and accurate warnings when it has done
> more analysis of the code - that requires optimisation to be enabled.
>
> Additionally, if you want to do debugging or look at generated assembly,
> this is (IME) usually much easier to work with when you use -O1 than no
> optimisation, as the generated code without any optimisation is
> painfully inefficient and you can't see what is going on for all the
> moves back and forth from the stack.
Thanks for this response. I hadn't thought of this, but I have noticed
this in *practice*, having compiled so much code as a distro packager
over the years. I will take this to heart when testing my code on a
go-forward basis.
>> I have been using:
>>
>> gcc -Wall -Wextra -pedantic -std={c89,c99} -ansi -g
>
> "-ansi" should not be used - it is equivalent to "-std=c90" but less
> explicit and less accurate (ANSI C is commonly used to mean C89 or C90,
> but technically means "the current ISO C standard", i.e., C18.
Thanks for pointing this out. I seemed to remember -ansi did something
slightly different than -std=c90 and could be used in conjunction with
-std=c99 & friends as well, but I just checked the gcc manual, and you
are absolutely correct. Now if only I could remember what I had
actually read, and what option I had possibly confused -ansi with...
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
max of 3 axel porin <porinaxel@gmail.com> - 2020-08-22 02:12 -0700
Re: max of 3 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-08-22 02:38 -0700
Re: max of 3 axel porin <porinaxel@gmail.com> - 2020-08-22 03:24 -0700
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-22 15:53 +0200
Re: max of 3 Elijah Stone <elronnd@elronnd.net> - 2020-08-22 19:03 -0700
Re: max of 3 James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-08-22 22:13 -0400
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-23 13:42 +0200
Re: max of 3 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-08-22 10:54 +0100
Re: max of 3 Bart <bc@freeuk.com> - 2020-08-22 11:24 +0100
Re: max of 3 axel porin <porinaxel@gmail.com> - 2020-08-22 03:29 -0700
Re: max of 3 axel porin <porinaxel@gmail.com> - 2020-08-22 03:38 -0700
Re: max of 3 axel porin <porinaxel@gmail.com> - 2020-08-22 04:06 -0700
Re: max of 3 James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-08-22 07:49 -0400
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-22 15:58 +0200
Re: max of 3 Poprocks <please@replytogroup.com> - 2020-08-22 15:15 -0400
Re: max of 3 James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-08-22 16:49 -0400
Re: max of 3 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-08-22 20:56 +0000
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-22 22:56 +0200
Re: max of 3 James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-08-22 17:04 -0400
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-23 13:55 +0200
Re: max of 3 Poprocks <please@replytogroup.com> - 2020-08-22 17:33 -0400
Re: max of 3 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-08-23 05:54 +0000
Re: max of 3 axel porin <porinaxel@gmail.com> - 2020-08-23 01:59 -0700
Re: max of 3 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-08-23 10:22 +0000
Re: max of 3 Öö Tiib <ootiib@hot.ee> - 2020-08-23 03:27 -0700
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-23 14:05 +0200
Re: max of 3 Bart <bc@freeuk.com> - 2020-08-23 14:09 +0100
Re: max of 3 David Brown <david.brown@hesbynett.no> - 2020-08-23 15:58 +0200
Re: max of 3 Bart <bc@freeuk.com> - 2020-08-23 11:33 +0100
Re: max of 3 Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-08-23 07:04 -0700
Re: max of 3 John Forkosh <forkosh@panix.com> - 2020-08-24 10:26 +0000
Re: max of 3 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-08-22 16:26 -0700
Re: max of 3 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-08-22 16:06 -0700
Re: max of 3 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-08-22 16:41 -0700
Re: max of 3 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-08-22 19:42 +0100
Re: max of 3 Daniel Hyde <Daniel.Hyde71@gmail.com> - 2020-08-22 12:27 +0200
Re: max of 3 Siri Cruise <chine.bleu@yahoo.com> - 2020-08-22 04:20 -0700
Re: max of 3 Daniel Hyde <Daniel.Hyde71@gmail.com> - 2020-08-22 17:14 +0200
Re: max of 3 Siri Cruise <chine.bleu@yahoo.com> - 2020-08-22 13:55 -0700
Re: max of 3 Daniel Hyde <Daniel.Hyde71@gmail.com> - 2020-08-23 11:18 +0200
Re: max of 3 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-08-22 20:08 +0100
Re: max of 3 Bart <bc@freeuk.com> - 2020-08-22 13:01 +0100
Re: max of 3 gazelle@shell.xmission.com (Kenny McCormack) - 2020-08-22 16:23 +0000
Re: max of 3 Bart <bc@freeuk.com> - 2020-08-22 20:45 +0100
Re: max of 3 Barry Schwarz <schwarzb@delq.com> - 2020-08-22 08:26 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-22 14:45 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-22 14:47 -0700
Re: max of 3 axel porin <porinaxel@gmail.com> - 2020-08-22 15:16 -0700
Re: max of 3 luser droog <luser.droog@gmail.com> - 2020-08-22 15:28 -0700
Re: max of 3 Real Troll <real.troll@trolls.com> - 2020-08-22 19:50 -0400
Re: max of 3 Paul <nospam@needed.invalid> - 2020-08-22 19:44 -0400
Re: max of 3 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-08-24 14:29 -0700
Re: max of 3 Barry Schwarz <schwarzb@delq.com> - 2020-08-22 18:32 -0700
Re: max of 3 Real Troll <real.troll@trolls.com> - 2020-08-23 12:30 -0400
Re: max of 3 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-08-22 16:37 -0700
Re: max of 3 Ike Naar <ike@sdf.org> - 2020-08-22 22:10 +0000
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-22 16:49 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-22 16:50 -0700
Re: max of 3 Real Troll<real.troll@trolls.com> - 2020-08-22 17:17 -0400
Re: max of 3 Barry Schwarz <schwarzb@delq.com> - 2020-08-22 18:22 -0700
Re: max of 3 luser droog <luser.droog@gmail.com> - 2020-08-22 15:42 -0700
Re: max of 3 luser droog <luser.droog@gmail.com> - 2020-08-22 15:52 -0700
Re: max of 3 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-08-24 14:16 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-24 14:37 -0700
Re: max of 3 Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-08-24 15:25 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-24 20:15 -0700
Re: max of 3 luser droog <luser.droog@gmail.com> - 2020-08-24 20:32 -0700
Re: max of 3 luser droog <luser.droog@gmail.com> - 2020-08-24 23:35 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-27 14:03 -0700
Re: max of 3 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-08-28 23:35 -0700
Re: max of 3 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-08-29 04:52 -0700
Re: max of 3 luser droog <luser.droog@gmail.com> - 2020-08-24 20:27 -0700
Re: max of 3 Vir Campestris <vir.campestris@invalid.invalid> - 2020-08-27 22:19 +0100
Re: max of 3 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-08-27 14:36 -0700
Re: max of 3 Kaz Kylheku <793-849-0957@kylheku.com> - 2020-08-27 22:27 +0000
Re: max of 3 Vir Campestris <vir.campestris@invalid.invalid> - 2020-08-31 22:07 +0100
Re: max of 3 Richard Damon <Richard@Damon-Family.org> - 2020-09-01 07:19 -0400
Re: max of 3 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-08-29 05:19 -0700
Re: max of 3 DFS <nospam@dfs.com> - 2020-08-26 19:25 -0400
csiph-web