[fpc-devel] FPC Language Specification

2019-05-19 Thread J. Gareth Moreton
So after my argument and the counterarguments regarding the new case block warnings, I'm starting to wonder if a semi-official specification should be written for FPC's dialect of Pascal, much like ISO 7185 for Extended Pascal.  While FPC is probably the only tool that will use this dialect, it

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

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 that

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] [Patch/RFC] Warnings for (in/over)complete case statements

2019-05-19 Thread Ondrej Pokorny
On 12.05.2019 16:36, Jonas Maebe wrote: Thanks. I have added these warnings to the compiler in r42047, and also the static/dynamic errors for Standard resp. Extended ISO Pascal. By default, the warnings are enabled for * enums * boolean * integer subrange types that don't span the entire range

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 proje

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 n

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 nested

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 w

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 Laz

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 f

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 m