znalazłem to niesamowite dzieło Arthur Whitney - http://www.jsoftware.com/jwiki/Essays/IncunabulumJak mogę skompilować i uruchomić ten program, napisany 1989 C?
on skompilowany z kilkoma ostrzeżeń
$ gcc-4.7 incuna.c -o incuna.o
incuna.c: In function 'ma':
incuna.c:8:15: warning: incompatible implicit declaration of built-in function 'malloc' [enabled by default]
incuna.c: In function 'pi':
incuna.c:26:7: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
incuna.c: In function 'nl':
incuna.c:26:24: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
incuna.c: In function 'pr':
incuna.c:28:10: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
incuna.c: In function 'ex':
incuna.c:35:36: warning: assignment makes integer from pointer without a cast [enabled by default]
incuna.c:35:25: warning: return makes pointer from integer without a cast [enabled by default]
incuna.c: In function 'noun':
incuna.c:37:57: warning: return makes integer from pointer without a cast [enabled by default]
incuna.c: In function 'wd':
incuna.c:39:21: warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default]
Ale segfaulted na wprowadzeniu Basic Input 1 + 1
.
./incuna.o
warning: this program uses gets(), which is unsafe.
1 + 1
[1] 11525 segmentation fault ./incuna.o
zgaduję to ma coś wspólnego z różnicą w kompilator C od 1989
Jak będę mógł uruchomić ten? Czy mogę to zrobić działając na ostatnim systemie Linux/Mac? lub na maszynie wirtualnej VirtualBox? albo coś innego?
Moje wyszukiwania Google pojawiło się nic związanego.
Być może możesz spróbować uruchomić program w gdb, aby zobaczyć więcej informacji? –
'#include' może? Edycja: skorygowana składnia –
leppie
Wygląda to na przepełnienie bufora z powodu pobrania() – Zaffy