version 4.03 gets() function warning

new topic     » topic index » view thread      » older message » newer message

The following program can be used to demonstrate the problem

 
-- TEST.EXW ---------------------------------------------------------------- 
-- 
sequence in = {} 
puts(1,"\nEnter a short sequence like ' abcd ' : ") 
in = gets(0) 
puts(1,"\n") 
? in 
puts(1,"\nNote how the gets(0) returns the sequence ending with {13,10} or {10}\n"& 
       "\nNow translate this program with -wat or -gcc option and run it\n"& 
       "again to see how it ends") 
if getc(0) then end if 
-- 
-- END TEST.EXW ------------------------------------------------------------ 


In the past we have been using an interpreter built with Watcom
and Translating using Watcom.

If you DON'T use a WATCOM built interpreter and translate with the -wat option
the gets() function returns a DIFFERENT termination.

In other words if you write code to strip off 13,10 ending and translate with a different compiler
You will get different results than what you were expecting

Perhaps this may case strange problems like in TRACE code, or other code.

Also this will be problem with using older code not written for MinGW

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu