TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Henk den Adel
from: Mike Bilow
date: 1997-02-06 00:29:46
subject: redirection revision

Henk den Adel wrote in a message to Bill Christensen:

 HdA> When i compile this program using Borland C++ version 1.0,
 HdA> the result is: 

D:\he3>bcc test.c

 HdA> Borland C++ Version 1.00 Copyright (c) 1993 Borland
 HdA> International

Version 1.00?!  I think I have that somewhere.  I don't recall ever even
getting it to run.  There was a v1.01 massive bug fix and then a v1.50 that
actually worked, followed by the v2.00 that seems to have been the
swansong.

 HdA> test.c: Error test.c 13: Type mismatch in parameter '__func' in 
 HdA> call to 'signal' in function main
 HdA> Warning test.c 39: Parameter 'sig' is never used in function
 HdA> emergency *** 1 errors in Compile ***

 HdA> bcc nags about the type of the function emergency. Renaming
 HdA> it into whatever name, makes no difference, it is not a
 HdA> predefined name. Using different types (int etc.) does not
 HdA> change the error message. I can't find the definition of
 HdA> signal in the include files, so i can't check what's wrong.
 HdA> Any idea? My test.c source is a copy of the example in
 HdA> Borlands manual. Borlands example, literally copied from
 HdA> page 285, produces the same error message.

First, "signal()" had better be prototyped in SIGNAL.H or it is
an ANSI violation.  Second, compiler internals are not named common things
such as "emergency," and any such names are preceded by a double
underscore.  The signal handler function must take an 'int' and return
'void' -- as required by ANSI.  If your ancient Borland compiler doesn't
understand this, it is broken.

 HdA> IBM's icc compiles my source without problems.

What does this tell you?  ICC is a fairly strict compiler.

 HdA> The results are astonishing: the mere fact that a signal
 HdA> function is invoked, is sufficient to fflush the buffers
 HdA> both of the redirected i/o as well as the streamed file. The
 HdA> trap 005 is gone, the violation remains. So far so good. Now
 HdA> back to the program i want to debug...

This is not really a solution.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 323/107 396/1 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.