amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
29 stars 6 forks source link

Compile error: implicit declaration of print_to_end_of_buffer #4

Closed gbonnema closed 7 years ago

gbonnema commented 7 years ago

Hi Alessandro,

I get compilation errors for the function print_to_end_of_buffer. When searching for the definition, I find the function is used before it is declared. See below. As you can see, we_prog.c at 1496 defines the function, and there is no prototype of the function that I recognize. Also, we_debug.c uses it, but as the declaration/definition is not in a header file, the compiler doesn't accept that either.

How does that work out for you? Am I missing something here? You had no compilation errors, how can that be?

 gbonnema  ~  projects  c  xwpe  ack print_to_end_of_buffer we_debug.c 371: print_to_end_of_buffer(b, str, b->mx.x); 783: print_to_end_of_buffer(b, str2, b->mx.x);

we_prog.c 285: print_to_end_of_buffer(b, estr, b->mx.x); 486: print_to_end_of_buffer(b, buff, b->mx.x); 524: print_to_end_of_buffer(b, "Success", b->mx.x); 1496:int print_to_end_of_buffer(BUFFER b,char str,int wrap_limit) 1587: print_to_end_of_buffer(b, str, b->mx.x);  gbonnema  ~  projects  c  xwpe  

amagnasco commented 7 years ago

That's bizarre. It should be a warning, not an error; that implicit declaration has been around for a while, and there's no record online of it breaking the compile for anyone. It should only break on C99 or earlier.

Can you paste your compile log? What version of gcc are you using? If < 4.6, try using 6.3.

gbonnema commented 7 years ago

Well, that's embarrassing. They are just warnings ( hiding my face behind my hands ). Thank you very much: i was able to run xwpe, and apparantly it works, edit-compile-run on a scratch program.

Thank you very much. ( still embarrassed )

EDIT: It also works on a pty (ctrl-alt-F3) using wpe. I must say, I am very impressed that a program abandoned some time ago still works as far as I can see. Pretty impressive!