Re: Inquiry Regarding -Wrange-loop-construct Warning Behavior in GCC 14

2024-09-13 Thread Jonathan Wakely via Gcc
On Fri, 13 Sept 2024 at 12:52, Jonathan Wakely wrote: > > On Fri, 13 Sept 2024 at 10:30, Sunil Kumar Dora > wrote: > > > > Dear GCC Community, > > I am currently encountering an issue with the -Wrange-loop-construct > > warning in GCC version 14, as well as in earlier versions. It appears that

Re: Inquiry Regarding -Wrange-loop-construct Warning Behavior in GCC 14

2024-09-13 Thread Jonathan Wakely via Gcc
On Fri, 13 Sept 2024 at 10:30, Sunil Kumar Dora wrote: > > Dear GCC Community, > I am currently encountering an issue with the -Wrange-loop-construct warning > in GCC version 14, as well as in earlier versions. It appears that the > warning is triggered incorrectly for certain loop constructs. >

Inquiry Regarding -Wrange-loop-construct Warning Behavior in GCC 14

2024-09-13 Thread Sunil Kumar Dora
Dear GCC Community, I am currently encountering an issue with the -Wrange-loop-construct warning in GCC version 14, as well as in earlier versions. It appears that the warning is triggered incorrectly for certain loop constructs. Issue Details: I have tested the following code, which produces a w

Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9

2014-04-01 Thread Daniel Gutson
On Tue, Apr 1, 2014 at 3:52 PM, Jonathan Wakely wrote: > On 1 April 2014 15:00, Daniel Gutson wrote: >>> For regressions, yes, but I don't think this is a regression. >> >> Why not? (I don't know the criteria, please let me know). > > Did it work in previous versions? > > A regression means someth

Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9

2014-04-01 Thread Jonathan Wakely
On 1 April 2014 15:00, Daniel Gutson wrote: >> For regressions, yes, but I don't think this is a regression. > > Why not? (I don't know the criteria, please let me know). Did it work in previous versions? A regression means something that used to work no longer works. > Upcoming Ubuntu LTS will

Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9

2014-04-01 Thread Daniel Gutson
On Tue, Apr 1, 2014 at 10:54 AM, Jonathan Wakely wrote: > On 1 April 2014 14:43, Daniel Gutson wrote: >> >> The attached patch attempts to fix this issue. Since I no longer have >> write access, please >> apply this for me if correct (is the 4.8 branch still alive for adding >> fixes?). > > For r

Re: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9

2014-04-01 Thread Jonathan Wakely
On 1 April 2014 14:43, Daniel Gutson wrote: > > The attached patch attempts to fix this issue. Since I no longer have > write access, please > apply this for me if correct (is the 4.8 branch still alive for adding > fixes?). For regressions, yes, but I don't think this is a regression. > Regardi

[PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9

2014-04-01 Thread Daniel Gutson
Hi, I observed two different behaviors in gcc 4.8.2 and 4.9 regarding the same issue, IMO both erroneous. Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't work in cases such as: void* p = 0; #pragma GCC diagnostic ignored "-pedantic" F* f2 = reinterpret_cast(p); (se

Re: Warning Behavior

2005-08-23 Thread jlh
Andreas Schwab wrote: > Try -Wextra. Ah thanks! I have already lost time several times due to this almost invisible mistake and I didn't know -Wextra would catch it. However, it seems to only work for the C compiler, not for C++. (Using GCC 3.4.4) (Oops, sorry Andreas, I actually meant to only

Re: Warning Behavior

2005-08-23 Thread Andreas Schwab
Ivan Novick <[EMAIL PROTECTED]> writes: > How come the following code would not be considered a Warning? Try -Wextra. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D

Re: Warning Behavior

2005-08-22 Thread Paolo Bonzini
Ivan Novick wrote: Hello, How come the following code would not be considered a Warning? Surely there is no possible way this would be intentional? if (x<4); x++; When you consider macro expansion, it could: #if SIZEOF_LONG == 4 #define WARN_FOR_BIG_VALUES \ printf ("hey, x is too

Warning Behavior

2005-08-22 Thread Ivan Novick
Hello, How come the following code would not be considered a Warning? Surely there is no possible way this would be intentional? if (x<4); x++; Cheers, Ivan