Talk:Steffensen's method
Algol68g solution results in warnings during execution
Hi;
This is common for me when grabbing Algol68g Rosetta Code task solutions.
I'm using MacOS 15.0 (Sequoia) [but the warnings occurred using the prior MacOS version] algol68g from MacPorts
a68g --version Algol 68 Genie 3.5.5
Should I be turning off the warnings? I'm not currently using any flags...
10 PROC aitken = ( PROC(REAL)REAL f # function double to double # 1 a68g: warning: 1: declaration hides a declaration of "f" with larger reach, in closed-clause starting at "BEGIN" in line 5. 21 PROC steffensen aitken = ( PROC(REAL)REAL f # function double to double # 1 a68g: warning: 1: declaration hides a declaration of "f" with larger reach, in closed-clause starting at "BEGIN" in line 5.
Thanks, Retired Build Engineer
- Hi Retired Build Engineer,
- Yes, ALGOL 68 Genie does generate those warnings if warnings are enabled.
- In ALGOL 68 Genie version 3, warnings are on by default, in version 2, they are off by default.
- Personally, I would leave them on.
- Note that if file inclusion is used (PR read "x" PR) to include library code, if something in the included file is not used, a warning is issued. As it is unlikely that everything in a library is used by a program, I tend to live with the warnings (imagine what it would be like if the C compiler issued a warning for everything in stdio.h that the program wasn't using...)
- Note that TIO.RUN appears to have ALGOL 68 Genie version 2.
- I confess that I do most of the development for my Algol 68 programs for RC using version 2, partly because of this...
- As the particular program you are highlighting here was translated from the ATS sample, I left the names as per the original, however I have just changed it to avoid the warnings for you. Perhaps the ATS compiler doesn't warn about such things - I've never used it so I can't say.
- Incidently, I put <pre>...</pre> around the messages, for ease of reading - hope you don't mind.
- So, are you running every program in every language on Rosetta Code ?
- BTW, if you put --~~~~, you will get a timestamped signature like this one: --Tigerofdarkness (talk) 21:41, 22 September 2024 (UTC)
Hi Tigerofdarkness;
understand your take on the warnings...
I have lots to learn about markup...thank you for the markup improvement of my discussion posting.
I am trying to learn from every Rosetta Code task in every (locally) supported Rosetta Code language...so that's about 61 languages on my Mac :-)
Secondly, I am trying to add solutions to Rosetta Code tasks that don't already have an Ada solution, as my primary goal was to (re-)learn everything (especially Ada) that I didn't fully grok in college or didn't get a chance to use while employed (obviously when I get paid I have to follow priorities of the employer).
--Retired Build Engineer (talk) 21:56, 22 September 2024 (UTC)
Thanks for highlighting the warnings, Retired Build Engineer - it prompted me to think about the issue a bit more and I have modified the files, primes, rows and sort libraries to avoid the "not used" warnings (and the "declaration hides a declaration in an outer scope") warnings.
I've left the L-System library as it was as there would be little point including the library if you weren't going to use something in it...
It seems that using the routines, operators, etc. in the THEN part of an IF FALSE THEN ... FI
construct will suppress the "not used" warnings.
I'll try and pay more attention in future as warning-free is best.
Thanks again, --Tigerofdarkness (talk) 17:11, 26 September 2024 (UTC)
Hi Tigerofdarkness;
This is AWESOME! I'm glad to be able to add value...
--Retired Build Engineer (talk) 19:55, 26 September 2024 (UTC)