[M3devel] SIG_DFL, SIG_IGN duplication (and RTSignal.m3 duplication)
Jay
jay.krell at cornell.edu
Mon Jan 5 21:27:50 CET 2009
SIG_DFL and SIG_IGN are effectively duplicated twice for every platform.
Once in Usignal.i3, once in RTSignal.m3.
1) The duplication in RTSignal.m3 I would think wouldn't be needed if module initialization occurs in a "correct" order. ?
2) The duplication in RTSignal.m3 could be eliminated if all platforms defined Usiginal.SIG_DFL, SIG_IGN, like Darwin and Solaris do -- a constant integer that you must LOOPHOLE instead of a correctly type variable that gets initialized (the variables have multiple correct types besides, due to signal handlers having at least three possible prototypes, ANSI C, BSD, and POSIX).
Perhaps Usignal could provide both a constant integer for folks to LOOPHOLE, and a typed initialized variable.
Since both sides are system-dependent, there isn't a "disconnect", porters just have to check both copies.
Apparently the values are always the same across all platforms, but that might be a coincidence of sorts. I rather suspect in the old days, people copied C header content around a lot to other C code, leading to values like becoming impossible to change, including constants and types, not just the arguably "easier" function prototypes.
Anyway, my inclination is rewrite the small number of clients in C, fixing both this, and reducing the cloned headers. -- As well stopping the duplication of RTSignal.m3, of which there are 37 nearly identical copies, or roughly 3 variants duplicated 37 times (again, ANSI, BSD, POSIX).
Other clients I see are:
C:\dev2\cm3.2\m3-libs\m3core\src\float\DS3100\FloatMode.m3(360): ELSIF (p = Usignal.SIG_DFL) THENC:\dev2\cm3.2\m3-libs\m3core\src\float\IRIX5\FloatMode.m3(361): ELSIF (p = Usignal.SIG_DFL) THENC:\dev2\cm3.2\m3-libs\m3core\src\float\DS3100\FloatMode.m3(358): IF (p = Usignal.SIG_IGN) THENC:\dev2\cm3.2\m3-libs\m3core\src\float\IRIX5\FloatMode.m3(359): IF (p = Usignal.SIG_IGN) THEN
but these are dead for multiple reasons.
The platforms are dead/dormant, and platform-specific FloatMode is dead in general, though perhaps should not be. (I do have a machine running Irix so hope to get that building/working before much longer...DS3100 no.)
- Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090105/88fa585e/attachment-0001.html>
More information about the M3devel
mailing list