Clean up 1987/wall warnings, fix README.md to run

(Well .. some warnings. See below.)

Depending on system (compiler and possibly platform) different warnings
were being triggered. It was easy to fix the code for some of them (like
wrong prototypes and then #including stdlib.h) but this caused problems
in another way (in macOS clang - clang is more strict and has -Werror or
else an equivalent by default which might or might not be possible to
disable .. haven't tried it) but since the code works as is I simply
silenced the warnings in the Makefile.

A note that might be useful to know for other Makefiles that has to do
with the fact that macOS gcc equates to clang (which I have noted many
times as it's an unfortunate problem): since it is seen as gcc the
Makefile check for gcc only will be triggered in macOS even though the
compiler is clang.

A similar problem is that if one does in linux just 'make' they might
end up with the compiler being 'cc' so I added an ifeq in the Makefile
for just cc. It might or might not be useful to add this to the rest of
the entry Makefiles. The same warnings disabled for cc and gcc were
added.

Another thing to keep in mind is with gcc/cc in linux it will still show
the warnings that were silenced as in it will show that some warnings
might have been disabled (it won't warn about the problems but will note
that some warnings were disabled - no I can't figure out the real
purpose of it either other than to be extra careful .. or annoying :-) ).

In linux clang also triggers even more warnings including the ridiculous
misleading indentation that they unfortunately adopted from gcc. These
warnings were not disabled at this time.

As far as the README.md goes one of the to run commands was incorrect in
that when running './wall' by itself one should put in numbers only, not
just any text.
This commit is contained in:
Cody Boone Ferguson committed 2023-09-28 04:13:43 -07:00
1 parent 55ad41edcf
commit 3a2829f98e
2 files changed
+15 -5

No files matched your search

+2 -3
View File
@@ -14,10 +14,10 @@ make all
```sh
./wall
# enter some strings
# enter some numbers
./wall | some_command
# enter some strings
# enter some strings or numbers, depending on command
```
@@ -47,7 +47,6 @@ m*m
./wall | cat
```
and enter some input like:
```