Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-02-24
03:37 • Closed ticket [40c61a5d10]: Compiler warning/inconsistant error-message in TIP #... artifact: 532f030975 user: apnadkarni
03:36 • Ticket [40c61a5d10]: 3 changes artifact: 4d6d17af3b user: apnadkarni
03:35
Bug [40c61a5d10]. Fix syntax error message. check-in: ebf20c29bd user: apnadkarni tags: tip-656
03:00 • Ticket [40c61a5d10] Compiler warning/inconsistant error-message in TIP #656 impl... artifact: fb21d8fda5 user: apnadkarni
2023-02-23
11:47 • Ticket [40c61a5d10]: 3 changes artifact: f21a7b1c19 user: jan.nijtmans
10:24 • Ticket [40c61a5d10]: 3 changes artifact: a344c8328c user: apnadkarni
10:22
Fix gcc warnings and encoding error message (bug [40c61a5d10]) check-in: 00b03d47c5 user: apnadkarni tags: tip-656
09:54 • Ticket [40c61a5d10] Compiler warning/inconsistant error-message in TIP #656 impl... artifact: 562e36a99b user: apnadkarni
07:37 • Ticket [40c61a5d10]: 3 changes artifact: fcadd953d7 user: jan.nijtmans
07:36 • New ticket [40c61a5d10]. artifact: 9620fbda37 user: jan.nijtmans

Compiler warning/inconsistant error-message in TIP #656 implementation

Closed / Fixed40c61a5d10e9b6478a096723bfc78fd85664f637Created 4 years agoUpdated 4 years ago
Descriptionwiki2023-02-23 07:36:46
Compiling the tip-656 branch, I see the following warning:
tclCmdAH.c: In function ‘EncodingConvertParseOptions’:
tclCmdAH.c:592:14: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
  592 |             "??-profile profile? ?-failindex var? ?encoding?? data");

Also, when running this:

% encoding convertfrom -profile tcl ascii
wrong # args: should be "::tcl::encoding::convertfrom ??-profile profile? ?-failindex var? ?encoding?? data"

This doesn't correspond with the TIP text, making 'encoding' mandatory when any other option is used.

Suggested solution, see here

Referenced by2
jan.nijtmans Ticket [40c61a5d10]: 3 changes [History diff]2023-02-23 07:37:02
apnadkarnimarkdown2023-02-23 09:54:18

Ah, trigraphs, first time I'm encountering them (inadvertently). I'll fix that.

With respect to your second point, I think the ? around encoding needs to be removed but outermost ? preserved. (Your edit removes the outermost ? which is not the same thing because it makes encoding always mandatory and disallows the 8.6 syntax encoding convertfrom abc.

Thanks for pointing this out.

By the way, TIP and implementation are still WIP. I hope to be done before the weekend.

/Ashok

apnadkarniplain2023-02-23 10:24:47
Fixed in [00b03d47c5]
jan.nijtmanswiki2023-02-23 11:47:49

> Your edit removes the outermost ? which is not the same thing ...

Did you notice the usage of "INTERP_ALTERNATE_WRONG_ARGS"? Most likely you are not aware of this feature. It's what other commands (like "socket") use when the syntax has multiple alternatives.

% encoding convertfrom -profile tcl ascii
wrong # args: should be "::tcl::encoding::convertfrom ?-profile profile? ?-failindex var? encoding data" or "::tcl::encoding::convertfrom data"

This way, we put the prefered syntax (making 'encoding' mandatory) first, and the alternative (for 8.6 compatibility) second ☺

apnadkarnimarkdown2023-02-24 03:00:45

Sorry, you're right on all counts. I didn't know about the INTERP_ALTERNATE_WRONG_ARGS feature, didn't notice it in your patch and message. Should have looked more closely.

It is indeed better. Will make that fix. Thanks.

/Ashok

apnadkarni Ticket [40c61a5d10]: 3 changes [History diff]2023-02-24 03:36:20
apnadkarni Closed ticket [40c61a5d10]. [History diff]2023-02-24 03:37:17
Log in (anonymous is fine) to add a comment.