DH> MS> void (__cdecl * __func)(int)
DH>I've declared and defined it as follows:
DH>void cbrk_handler(void);
DH>void cbrk_handler(void)
DH>Yet, I get an compiler error on:
DH>signal(SIGINT, cbrk_handler);
EW> And so you should. The default function calling convention in BC for
EW> DOS was "cdecl". BC OS/2 has a default of
"stdcall," which is supposed
EW> to be better. The signal handler must be "cdecl."
Declare and define
EW> as follows:
This is the exact same thing that Borland told me. However, it
is completely wrong. The ISO C standard governs how you write
a program that uses signal. If you write your program according
to this standard, then the source file must compile with no
changes on that compiler. There is no excuse. Either your compiler
compiles it, or it isn't 100% ISO. Nowhere does ISO say that you
need to use "cdecl". In fact, quite the contrary, you're not
allowed to use "cdecl" because it is an undefined keyword.
BTW, Borland fixed the problem with BCOS2++ 1.5. BFN. Paul.
@EOT:
---
* Origin: Kludging up the works (3:711/934.9)
|