Fix 1993/vanb for clang
The problem was the usual suspect where any arg other than the first was not a char **. Instead O5 is no longer defined to be main() and it is its own function now which main() calls. The third arg starts out as a global variable that is passed into the function (which is recursive). Now the output is correct.
This commit is contained in:
1 parent
7d3ef55280
commit
8d9955f6b3
3 files changed
+18
-10
No files matched your search
+14
-7
@@ -10,21 +10,28 @@
|
||||
|
||||
make all
|
||||
|
||||
NOTE: we could not compile this entry under modern macOS but it will work
|
||||
fine under linux. It likely fails to compile under macOS because its gcc is
|
||||
actually just clang which is more strict about the type of the third
|
||||
argument of main(). If you have gcc under macOS it might work just as well.
|
||||
We did not test other systems.
|
||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to work with
|
||||
clang. The problem was that the third arg to main() was not a `char **`. Instead
|
||||
`O5()` (which was `main()`) is now its own function which main() calls with the
|
||||
right parameters. Thank you Cody for your assistance!
|
||||
|
||||
|
||||
### To run
|
||||
## To run:
|
||||
|
||||
./vanb 'exp'
|
||||
|
||||
where:
|
||||
'exp' an octal expression
|
||||
|
||||
## Judges' comments
|
||||
|
||||
## Try:
|
||||
|
||||
./vanb 1+1
|
||||
|
||||
./vanb 4+4
|
||||
|
||||
|
||||
## Judges' comments:
|
||||
|
||||
The octal expression may contain:
|
||||
|
||||
|
||||
Reference in new issue
Block a user