Re: [PATCH 2/3] Add a lot of dummy returns to avoid warnings with NO_NORETURN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andi Kleen wrote:

> To be honest it's still not clear to me what was wrong with patch (2).

Ah, ok.  From my point of view the patch was problematic since it adds
code that would be distracting to both humans and static analyzers.
For example, a person might wonder "why this return value and not
another?".  Even worse, if someone removes a die() call and introduces
a bug, we lose the benefit of the warnings you are suppressing.

>> In this case, since the NO_NORETURN knob is to work around a gcc bug,
>> wouldn't it make sense to add a -Wno-something-or-other option to
>> BASIC_CFLAGS or COMPAT_CFLAGS when it is set?
>
> The problem is that only relatively new gccs have options to do
> fine grained control on all warnings. So this would add more complications
> in the Makefile to check the compiler version

The default CFLAGS is very simple because git is supposed to be
possible to build with other compilers, too, and I wasn't suggesting
changing that.  But I suspect making NO_NORETURN assume a modern
enough gcc to trigger the bug might be ok.

Anyway, thanks for writing these patches.  I'm happy to see git get
faster.  As a side question, do you know if gcc provides a way to
print output about what profile-driven optimizations were especially
compelling, so they could help people think about how to reorganize
code to improve the non profile-driven builds, too?

Regards,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]