From 3908c44d41c710ab37e5256e2bd14c337fa33796 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 13 Mar 2023 08:44:52 -0700 Subject: [PATCH] Get 1986/marshall to compile and work with clang Choo choo! This did not take much that work but it required some casts because the third arg to main() was an int and now it's a char **. I tried to keep the layout as close to the original. The line lengths are the same as the original but some spaces are now non-spaces. I noted this in the README.md. As well in the README.md I have added an author's comments section. Still working on other README.md files for this. However I might try and get some entries to compile that previously did not. There was another entry in 1986 that this was not so simple to do so I moved on. Maybe I will revisit that another time (1986/holloway). --- 1986/marshall/README.md | 17 +++++++++++------ 1986/marshall/marshall.c | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/1986/marshall/README.md b/1986/marshall/README.md index 232c83af0..e81a5b848 100644 --- a/1986/marshall/README.md +++ b/1986/marshall/README.md @@ -11,20 +11,25 @@ Paoli, PA. 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 second -argument of main(). If you have gcc under macOS it might work just as well. +NOTE: Cody Boone Ferguson got this to compile and work with clang. It did not +work with clang because it is more strict about the second and third args to +main() and the third arg was an int. He notes that he tried to keep the picture +as close to the original. The line lengths are the same but some spaces had to +be changed to non-spaces. Thank you Cody for your help! # Judges' comments: This program prints the name of the picture. The layout is somewhat -pretty through it is not the usual sort of output one would expect +pretty though it is not the usual sort of output one would expect from printing a program! This program was selected for the 1987 t-shirt collection. -This program is known to give some C compilers a problems. + + +## Author's comments: + +No comments were provided by the author. Copyright (c) 1986, Landon Curt Noll & Larry Bassel. diff --git a/1986/marshall/marshall.c b/1986/marshall/marshall.c index b4484035a..b7f685340 100644 --- a/1986/marshall/marshall.c +++ b/1986/marshall/marshall.c @@ -3,12 +3,12 @@ ;char grrr ;main( r, - argv, argc ) int argc , + argv, argc ) char **argc , r ; char *argv[];{int P( ); #define x int i, j,cc[4];printf(" choo choo\n" ) ; x ;if (P( ! i ) | cc[ ! j ] & P(j )>2 ? j : i ){* argv[i++ +!-i] ; for (i= 0;; i++ ); -_exit(argv[argc- 2 / cc[1*argc]|-1<<4 ] ) ;printf("%d",P(""));}} +_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);printf("%d",P(""));}} P ( a ) char a ; { a ; while( a > " B " /* - by E ricM arsh all- */); }