Frank Heckenbach wrote:
Try this patch
The --param patch works, thanks.
(please test with various options and in various situations).
That is a risky thing to ask ... I was just busy putting "all" options on, when I found this:
[G4:~/gnu/testgpc/adriaan] adriaan% cat pedantic.pas program pedantic; const knil=nil; type double_t=double; begin end.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --gnu-pascal --pedantic pedantic.pas:2: error: ISO 7185 Pascal allows only simple constants pedantic.pas:3: error: ISO 7185 Pascal does not allow underscores in identifiers
This may not be correct (for all other non ISO features a warning is given, not an error).
Some results for other dialects:
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --borland-pascal --pedantic pedantic.pas:2: error: ISO 7185 Pascal allows only simple constants [G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --mac-pascal --pedantic pedantic.pas:2: error: ISO 7185 Pascal allows only simple constants pedantic.pas:3: error: unknown identifier `double' [G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --ucsd-pascal --pedantic pedantic.pas:2: error: ISO 7185 Pascal allows only simple constants pedantic.pas:3: error: unknown identifier `double' [G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --delphi-pascal --pedantic pedantic.pas:2: error: ISO 7185 Pascal allows only simple constants pedantic.pas:3: error: ISO 7185 Pascal does not allow underscores in identifiers
[I wonder if the feature of restricting language constructs with dialect options is worth the trouble maintaining it, except, of course, for both ISO standards, but, since the feature is there, I report whatever I find].
Regards,
Adriaan van Os
Adriaan van Os wrote:
(please test with various options and in various situations).
That is a risky thing to ask ... I was just busy putting "all" options on, when I found this:
[G4:~/gnu/testgpc/adriaan] adriaan% cat pedantic.pas program pedantic; const knil=nil; type double_t=double; begin end.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --gnu-pascal --pedantic pedantic.pas:2: error: ISO 7185 Pascal allows only simple constants pedantic.pas:3: error: ISO 7185 Pascal does not allow underscores in identifiers
This may not be correct (for all other non ISO features a warning is given, not an error).
No, some are warnings.
[G4:~/gnu/testgpc/adriaan] adriaan% gpc -c pedantic.pas --mac-pascal --pedantic pedantic.pas:3: error: unknown identifier `double'
That error should be correct, according to Peter's changes.
[I wonder if the feature of restricting language constructs with dialect options is worth the trouble maintaining it, except, of course, for both ISO standards, but, since the feature is there, I report whatever I find].
Adding more dialects is not so much trouble in this regard (the infracstructure is more complicated).
Making `--pedantic' more consistent (WRT errors or warnings) might be more troublesome, and I don't think it's worth it. It basically yields the intersection of all dialects which is even less usable than any single one of them, so this option is really only for ... as the name says. (The option itself comes from the backend and C where it makes more sense since dialects are far less diverse. So we support it for compatibility, but it's not really meant to be very useful.)
Frank