Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Marco van de Voort
Op 2019-05-19 om 19:24 schreef Sven Barth via fpc-devel: Mode delphi should be compatible. Better forbid coperators in combination with mode delphi if need be. I think that we should not forbid the use of COperators if the user want it just like we don't forbid the use of any

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Sven Barth via fpc-devel
Marco van de Voort schrieb am So., 19. Mai 2019, 14:04: > > Op 2019-05-19 om 13:50 schreef Michael Van Canneyt: > > Current C++ standards requires a space between the two > signs for > > nested templates, so I think it would be fine if we were to require > > that as well. Although I supposed

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Sven Barth via fpc-devel
Michael Van Canneyt schrieb am So., 19. Mai 2019, 13:51: > > > On Sun, 19 May 2019, Jonas Maebe wrote: > > > On 19/05/2019 13:25, Sven Barth via fpc-devel wrote: > >> And don't get me started about ">>". That one is going to annoy me > >> enough once I add support for nested specializations -.-

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Sven Barth via fpc-devel
Jonas Maebe schrieb am So., 19. Mai 2019, 13:29: > On 19/05/2019 13:25, Sven Barth via fpc-devel wrote: > > And don't get me started about ">>". That one is going to annoy me > > enough once I add support for nested specializations -.- > > Current C++ standards requires a space between the two >

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Ondrej Pokorny
On 19.05.2019 09:34, Sven Barth via fpc-devel wrote: J. Gareth Moreton > schrieb am So., 19. Mai 2019, 05:17: I just feel that in this case, it should be a note, not a warning, unless you're compiling under a dialect of Pascal (e.g. Extended) that

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread J. Gareth Moreton
I was talking about adding "else ;" to every single case block that deliberately didn't have one before.  A lot of them were inserted into the compiler source recently (although a number of the new else branches also trigger internal errors too, since it should never be reached). For any

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread wkitty42
On 5/18/19 9:42 PM, Ralf Quint wrote: A warning from the compiler is hence an appropriate response, telling the programmer to check the source and make a decision, even if it is adding an empty else clause to the offending case statement. Everything else is just "lazy programming", like it or

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Marco van de Voort
Op 2019-05-19 om 13:50 schreef Michael Van Canneyt: Current C++ standards requires a space between the two > signs for nested templates, so I think it would be fine if we were to require that as well. Although I supposed that would be Delphi-incompatible... I think we can argue that adding a

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Michael Van Canneyt
On Sun, 19 May 2019, Jonas Maebe wrote: On 19/05/2019 13:25, Sven Barth via fpc-devel wrote: And don't get me started about ">>". That one is going to annoy me enough once I add support for nested specializations -.- Current C++ standards requires a space between the two > signs for

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Jonas Maebe
On 19/05/2019 13:25, Sven Barth via fpc-devel wrote: And don't get me started about ">>". That one is going to annoy me enough once I add support for nested specializations -.- Current C++ standards requires a space between the two > signs for nested templates, so I think it would be fine if

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Sven Barth via fpc-devel
J. Gareth Moreton schrieb am So., 19. Mai 2019, 13:18: > Regarding the C-style assignment operators, some of the packages that come > with the compiler use them, and trying to build everything without the -Sc > flag will result in errors. Outside of that, the biggest one that stands > out is

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread J. Gareth Moreton
I'm aware of the term "lazy programmer", and to say I suffer from lazy programmer syndrome was still insulting because I pride myself on checking edge cases and making sure my code was thorough and robust (and if I overlook something in particular, I'll gladly have it pointed out so it can be

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Marco van de Voort
Op 2019-05-19 om 09:34 schreef Sven Barth via fpc-devel: The C-style operators are merely syntactic sugar and don't do any optimization of the operation. Also they can't be used on properties. Not to mention that not everyone likes their use (I for example am pondering whether I should add a

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Sven Barth via fpc-devel
J. Gareth Moreton schrieb am So., 19. Mai 2019, 05:17: > Yes, I'm jumpy, especially as you always like to open your responses > with a direct insult of some kind - yes, I checked. You want to kill me > or ban me from the mailing list, go right ahead. I'm sure Free Pascal > will survive without

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-19 Thread Ralf Quint
On 5/18/2019 8:16 PM, J. Gareth Moreton wrote: Yes, I'm jumpy, especially as you always like to open your responses with a direct insult of some kind - yes, I checked. Well, I just checked my send folder and this was the first response to you in at least the last two years, if ever... You want

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread J. Gareth Moreton
Yes, I'm jumpy, especially as you always like to open your responses with a direct insult of some kind - yes, I checked.  You want to kill me or ban me from the mailing list, go right ahead. I'm sure Free Pascal will survive without me. We will agree to disagree on that one.  I see a warning

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread Ryan Joseph
> On May 18, 2019, at 7:42 PM, Ralf Quint wrote: > > A warning from the compiler is hence an appropriate response, telling the > programmer to check the source and make a decision, even if it is adding an > empty else clause to the offending case statement. Everything else is just > "lazy

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread Ralf Quint
On 5/18/2019 3:42 PM, J. Gareth Moreton wrote: Lazy... you've got a bloody cheek.  Well I guess there's no point in me contributing anything more if that's how you honestly view me.  I wasn't aware of the ISO that dictated that a case block shouldn't just fall through until today, and C/C++

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread J. Gareth Moreton
Lazy... you've got a bloody cheek.  Well I guess there's no point in me contributing anything more if that's how you honestly view me.  I wasn't aware of the ISO that dictated that a case block shouldn't just fall through until today, and C/C++ and Basic never threw similar errors or warnings,

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread Ralf Quint
On 5/18/2019 4:30 AM, J. Gareth Moreton wrote: Hi everyone, So it looks like this new warning has appeared as part of the data flow analysis of -O4.  The thing is, I personally have a problem with this being a warning, because there's nothing inherently wrong with not covering every case

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread J. Gareth Moreton
Ah yes, I see now - I've found the relevant line in ISO7185, section 6.8.3.5: "One of the case-constants shall be equal to the value of thecase-index upon entry to the case-statement; otherwise, it shall be an error." Strict, but I guess that was what Pascal was built upon, and a good way

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread J. Gareth Moreton
Aah okay.  Thanks Martok and Jonas.  Adding internal errors is definitely a good haul then.  I do think a warning is a bit harsh though over a hint or a note, but if that is what you desire for the compiler (since it does reduce errors), then I'll accept it. I just missed the part where it

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread Martok
It's not DFA. See my proposal thread from January and Jonas' implementation from this week: > Warnings should indicate the possibility of unstable

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread Jonas Maebe
On 18/05/2019 13:30, J. Gareth Moreton wrote: So it looks like this new warning has appeared as part of the data flow analysis of -O4. The case-completeness warning is not related to any optimization level, nor to the data flow analysis mentioned in the other thread. The thing is, I

[fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread J. Gareth Moreton
Hi everyone, So it looks like this new warning has appeared as part of the data flow analysis of -O4.  The thing is, I personally have a problem with this being a warning, because there's nothing inherently wrong with not covering every case branch or omitting an else block (especially if one