Merge pull request #1017 from xexyl/1989-fubar-note
This commit is contained in:
6 files changed
+80
-14
No files matched your search
@@ -33,10 +33,13 @@ Run this with a single digit argument (or wait a long time).
|
|||||||
The blank line at the beginning of the source is mandatory.
|
The blank line at the beginning of the source is mandatory.
|
||||||
Do you know why?
|
Do you know why?
|
||||||
|
|
||||||
NOTE: don't try running [ouroboros.c](ouroboros.c) (note that it's executable)
|
NOTE: don't try running `ouroboros.c` (note that it's executable)
|
||||||
directly with an arg as it'll turn into an infinite loop. The same will happen
|
directly with an arg as it'll turn into an infinite loop. The same will happen
|
||||||
with larger numbers.
|
with larger numbers.
|
||||||
|
|
||||||
|
NOTE: the file `ouroboros.c` is created by the program itself so this is why it
|
||||||
|
is not in the repository.
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
In a nutshell, this is probably the slowest and most
|
In a nutshell, this is probably the slowest and most
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ include ../../var.mk
|
|||||||
|
|
||||||
# Common C compiler warnings to silence
|
# Common C compiler warnings to silence
|
||||||
#
|
#
|
||||||
CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-macro-redefined \
|
CSILENCE= -Wno-error -Wno-implicit-function-declaration \
|
||||||
-Wno-strict-prototypes
|
-Wno-strict-prototypes
|
||||||
|
|
||||||
# Common C compiler warning flags
|
# Common C compiler warning flags
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
# Most Portable Output
|
# Most Portable Output
|
||||||
|
|
||||||
Thaddaeus Frogley
|
Thaddaeus Frogley
|
||||||
Creature Labs
|
|
||||||
164 Hornbeams
|
|
||||||
Harlow, Essex
|
|
||||||
UK
|
UK
|
||||||
|
|
||||||
Gavin Buttimore
|
Gavin Buttimore
|
||||||
Creature Labs
|
UK
|
||||||
9 Elizabeth Way
|
|
||||||
Cambridge
|
|
||||||
UK, CB4 1DE
|
|
||||||
|
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ Just say
|
|||||||
|
|
||||||
* Algorithmically, it incorporates the following
|
* Algorithmically, it incorporates the following
|
||||||
- (inverse) Burrows-Wheeler transform (used also e.g. in bzip2)
|
- (inverse) Burrows-Wheeler transform (used also e.g. in bzip2)
|
||||||
- data compression (really expansion :-), run-lenght-encoding,
|
- data compression (really expansion :-), run-length-encoding,
|
||||||
unary coding (this is why it is expansion rather than compression)
|
unary coding (this is why it is expansion rather than compression)
|
||||||
- approximate string matching
|
- approximate string matching
|
||||||
- dynamic programming to compute the edit distance
|
- dynamic programming to compute the edit distance
|
||||||
|
|||||||
@@ -736,7 +736,69 @@ work but it only works with gcc. Cody removed the warnings of `gets()`.
|
|||||||
|
|
||||||
Unfortunately due to the way the entry works and the fact that other compilers
|
Unfortunately due to the way the entry works and the fact that other compilers
|
||||||
like clang have different warnings and errors this simply does not work with
|
like clang have different warnings and errors this simply does not work with
|
||||||
them. Can you help us?
|
them.
|
||||||
|
|
||||||
|
Some tips from Cody:
|
||||||
|
|
||||||
|
This entry relies on specific compiler warnings. With gcc it will look something
|
||||||
|
like:
|
||||||
|
|
||||||
|
```
|
||||||
|
[...]
|
||||||
|
lush.c: In function 'main':
|
||||||
|
lush.c:40: warning: "f" redefined
|
||||||
|
40 | main
|
||||||
|
|
|
||||||
|
lush.c:1: note: this is the location of the previous definition
|
||||||
|
1 | #define gets(_) fgets((_),999,stdin)
|
||||||
|
|
|
||||||
|
lush.c:42: warning: "f" redefined
|
||||||
|
42 | #define f 001:
|
||||||
|
|
|
||||||
|
lush.c:40: note: this is the location of the previous definition
|
||||||
|
40 | main
|
||||||
|
|
|
||||||
|
lush.c:44: warning: "f" redefined
|
||||||
|
44 | #define f 100:
|
||||||
|
|
|
||||||
|
lush.c:42: note: this is the location of the previous definition
|
||||||
|
42 | #define f 001:
|
||||||
|
|
|
||||||
|
lush.c:45: warning: "f" redefined
|
||||||
|
45 | _[i--
|
||||||
|
|
|
||||||
|
lush.c:44: note: this is the location of the previous definition
|
||||||
|
44 | #define f 100:
|
||||||
|
|
|
||||||
|
lush.c:46: warning: "f" redefined
|
||||||
|
46 | #define f 126:
|
||||||
|
|
|
||||||
|
lush.c:45: note: this is the location of the previous definition
|
||||||
|
45 | _[i--
|
||||||
|
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Now one can use `sed` to get the `warning:` line correct but there is more to it
|
||||||
|
than that. For instance this is what it looks like with clang:
|
||||||
|
|
||||||
|
```
|
||||||
|
lush.c:40:9: warning: 'f' macro redefined [-Wmacro-redefined]
|
||||||
|
#define f 001:
|
||||||
|
^
|
||||||
|
lush.c:1:9: note: previous definition is here
|
||||||
|
#define f 000:
|
||||||
|
^
|
||||||
|
lush.c:42:9: warning: 'f' macro redefined [-Wmacro-redefined]
|
||||||
|
#define f 100:
|
||||||
|
^
|
||||||
|
lush.c:40:9: note: previous definition is here
|
||||||
|
#define f 001:
|
||||||
|
^
|
||||||
|
```
|
||||||
|
|
||||||
|
As you might see the part under the `warning:` line is different.
|
||||||
|
|
||||||
|
Can you help us?
|
||||||
|
|
||||||
## [1992/westley](1992/westley/westley.c) ([README.md](1992/westley/README.md))
|
## [1992/westley](1992/westley/westley.c) ([README.md](1992/westley/README.md))
|
||||||
## STATUS: INABIAF - please **DO NOT** fix
|
## STATUS: INABIAF - please **DO NOT** fix
|
||||||
|
|||||||
+10
-3
@@ -642,6 +642,9 @@ it moves towards the right but if you click the mouse it goes back.
|
|||||||
Yusuke supplied a patch which makes this work with gcc. Due to how it works (see
|
Yusuke supplied a patch which makes this work with gcc. Due to how it works (see
|
||||||
Judges' remarks in the README.md file) this will not work with clang.
|
Judges' remarks in the README.md file) this will not work with clang.
|
||||||
|
|
||||||
|
Cody also provided the `runme.sh` script to demonstrate it as using make was
|
||||||
|
problematic.
|
||||||
|
|
||||||
Cody made it use `fgets()` instead of `gets()` to prevent annoying warnings
|
Cody made it use `fgets()` instead of `gets()` to prevent annoying warnings
|
||||||
getting in the way (in linux linking in a binary with `gets()` produces a
|
getting in the way (in linux linking in a binary with `gets()` produces a
|
||||||
warning that might get in the way with this entry and in macOS at runtime it
|
warning that might get in the way with this entry and in macOS at runtime it
|
||||||
@@ -652,8 +655,10 @@ with clang due to different compiler messages.
|
|||||||
|
|
||||||
Cody later improved the `fgets()` change to look more like the original i.e. it
|
Cody later improved the `fgets()` change to look more like the original i.e. it
|
||||||
now uses a redefined `gets()`. This did require modifying the line number with
|
now uses a redefined `gets()`. This did require modifying the line number with
|
||||||
`#line 1` under the macro `gets()`. Still this cannot work with clang due to
|
`#line 1` under the macro `gets()`.
|
||||||
different compiler messages. See [bugs.md](/bugs.md) for details.
|
|
||||||
|
Still this cannot work with clang due to different compiler messages. See
|
||||||
|
[bugs.md](/bugs.md) for details.
|
||||||
|
|
||||||
## [1992/nathan](1992/nathan/nathan.c) ([README.md](1992/nathan/README.md))
|
## [1992/nathan](1992/nathan/nathan.c) ([README.md](1992/nathan/README.md))
|
||||||
|
|
||||||
@@ -795,7 +800,9 @@ Cody fixed this so that it would work with macOS. Once it could compile it
|
|||||||
additionally segfaulted under macOS which he also fixed. Cody also provided the
|
additionally segfaulted under macOS which he also fixed. Cody also provided the
|
||||||
[Alternate code](1995/cdua/cdua.alt.c) for fun :-) ) (in particular to make it
|
[Alternate code](1995/cdua/cdua.alt.c) for fun :-) ) (in particular to make it
|
||||||
easier to see the program do what it does in systems that are too fast ... if
|
easier to see the program do what it does in systems that are too fast ... if
|
||||||
there is such a thing anyway :-) ).
|
there is such a thing anyway :-) ). See the README.md for details on this.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [1995/garry](1995/garry/garry.c) ([README.md](1995/garry/README.md]))
|
## [1995/garry](1995/garry/garry.c) ([README.md](1995/garry/README.md]))
|
||||||
|
|||||||
Reference in new issue
Block a user