这个程序怎么可能有意义?

edm*_*dmz 4 c

该程序既不是有效的C程序,也不是无效的C程序.但是,根据我的理解,它甚至不能被定义为处理单元计算的指令序列.

代码是:

That's it. The author alleges:

Some C compilers will compile an empty file into a program that does nothing. But even if your compiler can't, the build instructions supplied with this entry will produce an executable file. On most systems, the stdout from the executable will exactly match original source.

I don't buy it. The compilation will succeed, yielding no instructions. However, the linking will fail as there is no main符号可以调用.如果它可以运行,那么技巧将起作用,因为它不输出任何东西,源代码实际上什么都不包含.

那么,如何(字面上和在哪种环境下)将program其视为有效的自我复制程序?

注意:IOCCC已经接受了它.

Ale*_*ing 6

注意这个重要的一行:

但即使您的编译器不能,此条目提供的构建指令也将生成可执行文件.

有关实际的构建说明,请参阅makefile:

smr: smr.c
    @${RM} -rf smr
    ${CP} smr.c smr
    ${CHMOD} +x smr
Run Code Online (Sandbox Code Playgroud)

简而言之,这实际上只是创建了一个带有可执行位集的空文件,当然,它什么都不做.


hob*_*bbs 5

在"与此项提供的编译指令"意味着使用这个Makefilemake smr.

如果查看makefile,它根本不会调用C编译器; 它只是复制空源文件以制作一个空的二进制文件,然后chmod +x是它.

我不知道这个断言是多么真实,一个空的可执行文件构成了一个在"大多数系统"上什么都不做的程序,但它确实在我的网站上没有成功.