git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 0/2] -Wuninitialized
Date: Tue, 20 Mar 2018 22:41:05 +0000	[thread overview]
Message-ID: <ce46b318-2c37-4562-7e57-526f511cd6a8@ramsayjones.plus.com> (raw)
In-Reply-To: <20180320043225.GB13302@sigill.intra.peff.net>



On 20/03/18 04:32, Jeff King wrote:
> On Mon, Mar 19, 2018 at 05:53:09PM +0000, Ramsay Jones wrote:
 
>> If we now add a patch to remove all self-initialization, which would be the
>> first patch plus the obvious change to 'saved_namelen' in read-cache.c, then
>> note the warnings issued by various compilers at various optimization levels
>> on several different platforms [5]:
>>
>>                     O0      O1      O2      O3      Os       Og
>>  1) gcc 4.8.3   |   -      1,20     1    1,18-19  1-4,21-23  1,5-17
>>  2) gcc 4.8.4   |   -      1,20     1       1     1-4,21-23  1,5-8,10-13,15-16 
>>  3) clang 3.4   |   -       -       -       -        -       n/a 
>>  4) gcc 5.4.0   |   -       1       1       1     1,3-4,21   1,5-8,10-13,16-16
>>  5) clang 3.8.0 |   -       -       -       -        -       n/a 
>>  6) gcc 5.4.0   |   -       1       1       1       1-4     1,5-17 
>>  7) clang 3.8.0 |   -       -       -       -        -       n/a 
>>  8) gcc 6.4.0   |   -       1       1    1,18-19    1,4     1,5-17
>>  9) clang 5.0.1 |   -       -       -       -        -        -
>> 10) gcc 7.2.1   |   -       1       1       1       1,4     1,5-17
> 
> So I guess this could create headaches for people using DEVELOPER=1 on
> as ancient a compiler as 4.8.4, but most other people should be OK. I
> think I can live with that as a cutoff, and the Travis builds should
> work there.

Yeah, I have an even older laptop (Windows 95 era), but I'm not
sure if it will even boot these days. (It does have gcc on it
IIRC, but who knows which version). ;-)

> (And if we do the detect-compiler stuff from the other nearby thread,
> somebody who cares can even loosen the warnings for those old gcc
> versions).
> 
> I'm neglecting anybody doing -O3 or -Os here, but IMHO those are
> sufficiently rare that the builder can tweak their own settings.

I have occasionally used -O3, never used -Os (except for this
exercise) and have been meaning to try -Og (in anger) for a while. ;-)

> I wonder if people use -Og, though? I don't (I usually do -O0 for my
> edit-compile-debug cycle).

In the gcc documentation, the -Og description says:

  "... It should be the optimization level of choice for the standard
   edit-compile-debug cycle, ..."

Like you, I use -O0 (very old habits). As I said above, I have been
meaning to try -Og, but, well round tuits ... ;-)

[BTW, gcc also supports -Ofast, but I don't think we want to go
there ...]

ATB,
Ramsay Jones





  reply	other threads:[~2018-03-20 22:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 17:53 [PATCH 0/2] -Wuninitialized Ramsay Jones
2018-03-20  4:32 ` Jeff King
2018-03-20 22:41   ` Ramsay Jones [this message]
2018-03-20 14:46 ` Johannes Schindelin
2018-03-20 23:02   ` Ramsay Jones

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce46b318-2c37-4562-7e57-526f511cd6a8@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).