Merge pull request #218 from xexyl/1993-lmfjyh
This commit is contained in:
1 file changed
+52
-26
+52
-26
@@ -7,30 +7,52 @@
|
|||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
make all
|
This entry will not compile with gcc < 2.3.3 as it relied on a bug which was
|
||||||
|
fixed in gcc 2.3.3 which was fixed a very long time ago now. If you have such a
|
||||||
|
compiler you can run `make all`.
|
||||||
|
|
||||||
NOTE: This entry will not compile on modern systems because it relies on a
|
**WARNING**: Trying to compile this entry without the affected gcc will also
|
||||||
compiler bug which was fixed in gcc 2.3.3 (a very long time ago now). Trying to
|
make a bogus file on your file system. To delete it you can use the inode
|
||||||
compile it will also make a bogus file on your file system. To delete it you
|
option `-inum` with `find` with the delete option after finding the inode with
|
||||||
can use the inode option `-inum` with `find` with the delete option after
|
`ls -li` or else use a GUI to do it. Should you wish to try compiling it you
|
||||||
finding the inode with `ls -li`.
|
might see something like:
|
||||||
|
|
||||||
### To run
|
NOTE: This will not compile when using modern compilers because
|
||||||
|
it relies on a compiler bug which was fixed in gcc 2.3.3 (a very
|
||||||
|
long time ago now).
|
||||||
|
rm -f \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
||||||
|
cp lmfjyh.c \"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c
|
||||||
|
cc -std=gnu90 -Wall -Wextra -pedantic -include stdio.h -O3 \
|
||||||
|
\"\;main\(\)\{puts\(\"Hello\ World!\"\)\;\}char\*C=\".c -o lmfjyh
|
||||||
|
Undefined symbols for architecture arm64:
|
||||||
|
"_main", referenced from:
|
||||||
|
implicit entry/start for main executable
|
||||||
|
ld: symbol(s) not found for architecture arm64
|
||||||
|
clang: error: linker command failed with exit code 1 (use -v to see invocation)
|
||||||
|
make: *** [lmfjyh] Error 1
|
||||||
|
|
||||||
|
and the bogus file will be:
|
||||||
|
|
||||||
|
";main(){puts("Hello World!");}char*C=".c
|
||||||
|
|
||||||
|
For an explanation of why this is see the author's comments.
|
||||||
|
|
||||||
|
## To run:
|
||||||
|
|
||||||
|
If you have gcc < 2.3.3:
|
||||||
|
|
||||||
./lmfjyh
|
./lmfjyh
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments:
|
||||||
|
|
||||||
See the Makefile for details.
|
|
||||||
|
|
||||||
There's more than one way to get around disk quotas. :-)
|
There's more than one way to get around disk quotas. :-)
|
||||||
|
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments;
|
||||||
|
|
||||||
"Practical and efficient method of compressing source code"
|
"Practical and efficient method of compressing source code".
|
||||||
|
|
||||||
1. Introduction
|
### Introduction
|
||||||
|
|
||||||
I will shortly present a totally new compression method.
|
I will shortly present a totally new compression method.
|
||||||
It may be used to compress any types of files, but it works
|
It may be used to compress any types of files, but it works
|
||||||
@@ -41,13 +63,14 @@ There's more than one way to get around disk quotas. :-)
|
|||||||
|
|
||||||
Listing 1. A simple "Hello World" program:
|
Listing 1. A simple "Hello World" program:
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
puts("Hello World!");
|
puts("Hello World!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
2. Packing method
|
### Packing method
|
||||||
|
|
||||||
Normally a file name is used only to identify the file,
|
Normally a file name is used only to identify the file,
|
||||||
but this new revolutionary method introduces a totally new concept:
|
but this new revolutionary method introduces a totally new concept:
|
||||||
@@ -58,11 +81,13 @@ There's more than one way to get around disk quotas. :-)
|
|||||||
|
|
||||||
Listing 2. Compressed "Hello world":
|
Listing 2. Compressed "Hello world":
|
||||||
|
|
||||||
|
|
||||||
char*_=__FILE__;
|
char*_=__FILE__;
|
||||||
|
|
||||||
|
|
||||||
Listing 3. Code embedded in the file name:
|
Listing 3. Code embedded in the file name:
|
||||||
|
|
||||||
|
|
||||||
";main(){puts("Hello World!");}char*C=".c
|
";main(){puts("Hello World!");}char*C=".c
|
||||||
|
|
||||||
|
|
||||||
@@ -83,20 +108,20 @@ There's more than one way to get around disk quotas. :-)
|
|||||||
code in a source file as presented in listing 1.
|
code in a source file as presented in listing 1.
|
||||||
|
|
||||||
|
|
||||||
3. Packing files in a UNIX environment
|
### Packing files in a UNIX environment
|
||||||
|
|
||||||
In a UNIX environment it is possible to write almost any program by
|
In a UNIX environment it is possible to write almost any program by
|
||||||
including the code in file names. Since '/' is used to separate
|
including the code in file names. Since '/' is used to separate
|
||||||
path components and cannot therefore exist in a file name, all
|
path components and cannot therefore exist in a file name, all
|
||||||
features of C-language cannot be used.
|
features of C-language cannot be used.
|
||||||
|
|
||||||
In C, the '/' is used as a division operator and it may also be a
|
In C, the `/` is used as a division operator and it may also be a
|
||||||
part of a comment start and end identifier. This is, however, not a
|
part of a comment start and end identifier. This is, however, not a
|
||||||
dangerous limitation, since practice has shown that comments are
|
dangerous limitation, since practice has shown that comments are
|
||||||
almost totally unnecessary. A real programmer can more easily
|
almost totally unnecessary. A real programmer can more easily
|
||||||
understand pure source code, and misleading comments are
|
understand pure source code, and misleading comments are
|
||||||
disastrous. The division operation may be replaced with pow(x, -1)
|
disastrous. The division operation may be replaced with `pow(x, -1)`
|
||||||
and multiplication when using real numbers or with div() function
|
and multiplication when using real numbers or with `div()` function
|
||||||
when using integers.
|
when using integers.
|
||||||
|
|
||||||
Large programs must be separated into small modules. This enforces
|
Large programs must be separated into small modules. This enforces
|
||||||
@@ -105,7 +130,7 @@ There's more than one way to get around disk quotas. :-)
|
|||||||
code need not be recompiled after changes have been made.
|
code need not be recompiled after changes have been made.
|
||||||
|
|
||||||
|
|
||||||
4. Usage with currently available tools
|
### Usage with currently available tools
|
||||||
|
|
||||||
I have tested how well this new method works with currently
|
I have tested how well this new method works with currently
|
||||||
available programming tools.
|
available programming tools.
|
||||||
@@ -114,20 +139,22 @@ There's more than one way to get around disk quotas. :-)
|
|||||||
system should be able to compile the code. (there may be problems
|
system should be able to compile the code. (there may be problems
|
||||||
with some older UNIX variants)
|
with some older UNIX variants)
|
||||||
|
|
||||||
4.1. Compilers:
|
### Compilers:
|
||||||
|
|
||||||
These worked:
|
These worked:
|
||||||
|
|
||||||
gcc versions 2.0, 2.1, 2.3.2 (ld failed at AIX with gcc 2.1)
|
gcc versions 2.0, 2.1, 2.3.2 (ld failed at AIX with gcc 2.1)
|
||||||
cc (HP-UX)
|
cc (HP-UX)
|
||||||
cc (VAX)
|
cc (VAX)
|
||||||
|
|
||||||
These failed miserably:
|
These failed miserably:
|
||||||
|
|
||||||
cc (SunOs/Solaris) - could not start cpp properly
|
cc (SunOs/Solaris) - could not start cpp properly
|
||||||
cc/xlc (AIX) - could not open source
|
cc/xlc (AIX) - could not open source
|
||||||
|
|
||||||
4.2. Other tools:
|
### Other tools:
|
||||||
|
|
||||||
4.2.1 Debuggers: (tested at SunOs 4.1.2)
|
#### Debuggers: (tested at SunOs 4.1.2)
|
||||||
|
|
||||||
dbx - Quit with a very 'informative' error message:
|
dbx - Quit with a very 'informative' error message:
|
||||||
"dbx: fatal error: Is a directory"
|
"dbx: fatal error: Is a directory"
|
||||||
@@ -136,13 +163,12 @@ There's more than one way to get around disk quotas. :-)
|
|||||||
It was, however, possible to step through the code but
|
It was, however, possible to step through the code but
|
||||||
not list it.
|
not list it.
|
||||||
|
|
||||||
4.2.2 Lints:
|
#### Lints
|
||||||
|
|
||||||
- None of the lints at tested environments were able
|
None of the lints tested environments were able to parse the file.
|
||||||
to open the file.
|
|
||||||
|
|
||||||
|
|
||||||
5. Conclusions
|
### Conclusions
|
||||||
|
|
||||||
The method can be used to compress any types of files, actually the
|
The method can be used to compress any types of files, actually the
|
||||||
compression ratios are even better when compressing other files
|
compression ratios are even better when compressing other files
|
||||||
|
|||||||
Reference in new issue
Block a user