diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-06-17 23:39:53 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-06-17 22:57:43 +0200 |
commit | d9a36da6d785844139d291b37f80fbe087b2b59e (patch) | |
tree | 20fc3b30db07875601708204edeeb64008c11790 | |
parent | f519e6e262b4f0f3cf7f2ffd8f9634c9f05d6ed4 (diff) | |
download | mig-d9a36da6d785844139d291b37f80fbe087b2b59e.tar.gz mig-d9a36da6d785844139d291b37f80fbe087b2b59e.tar.bz2 mig-d9a36da6d785844139d291b37f80fbe087b2b59e.zip |
Remove error procedure directives
Back in the wonderful old days of Mach 2, when there were no send-once
rights, dead names, or port reference counts, MIG used to have more
kinds of operations: there were functions, procedures, simpleprocedures,
routines, and simpleroutines. Routines returned an error code as their C
function return value, functions had real return values, procedures and
simpleprocedures returned void.
Functions, procedures, and simpleprocedures signalled errors by invoking
a global function. By default, a function named MsgError was invoked,
but a subsystem could specify a different function using the 'error'
directive:
error CustomErrorHandler;
In Mach 3, functions, procedures, and simpleprocedures are gone.
Routines and simpleroutines are the only remaining kinds of operations.
Some 26 years later, most of the code for generating functions,
procedures, and simpleprocedures was removed from GNU MIG in commit
7f10b4ed6a557b7a1fd1083939156a3dcf8b377e. Error directives remained,
seemingly due to an oversight. So remove them too.
Found while trying to use the word 'error' as an identifier and
receiving a cryptic syntax error from MIG.
Message-Id: <20230617203953.622120-1-bugaevc@gmail.com>
-rw-r--r-- | global.c | 1 | ||||
-rw-r--r-- | global.h | 1 | ||||
-rw-r--r-- | lexxer.l | 1 | ||||
-rw-r--r-- | parser.y | 10 |
4 files changed, 0 insertions, 13 deletions
@@ -43,7 +43,6 @@ u_int SubsystemBase = 0; const_string_t MsgOption = strNULL; const_string_t WaitTime = strNULL; -const_string_t ErrorProc = "MsgError"; const_string_t ServerPrefix = ""; const_string_t UserPrefix = ""; const_string_t ServerDemux = strNULL; @@ -47,7 +47,6 @@ extern u_int SubsystemBase; extern const_string_t MsgOption; extern const_string_t WaitTime; -extern const_string_t ErrorProc; extern const_string_t ServerPrefix; extern const_string_t UserPrefix; extern const_string_t ServerDemux; @@ -130,7 +130,6 @@ static void doSharp(const char *body); /* process body of # directives */ <Normal>(?i:sreplyport) RETURN(sySReplyPort); <Normal>(?i:array) RETURN(syArray); <Normal>(?i:of) RETURN(syOf); -<Normal>(?i:error) RETURN(syErrorProc); <Normal>(?i:serverprefix) RETURN(syServerPrefix); <Normal>(?i:userprefix) RETURN(syUserPrefix); <Normal>(?i:serverdemux) RETURN(syServerDemux); @@ -36,7 +36,6 @@ %token syMsgSeqno %token syWaitTime %token syNoWaitTime -%token syErrorProc %token syServerPrefix %token syUserPrefix %token syServerDemux @@ -176,7 +175,6 @@ Statements : /* empty */ Statement : Subsystem sySemi | WaitTime sySemi | MsgOption sySemi - | Error sySemi | ServerPrefix sySemi | UserPrefix sySemi | ServerDemux sySemi @@ -287,14 +285,6 @@ WaitTime : LookString syWaitTime syString } ; -Error : syErrorProc syIdentifier -{ - ErrorProc = $2; - if (BeVerbose) - printf("ErrorProc %s\n\n", ErrorProc); -} - ; - ServerPrefix : syServerPrefix syIdentifier { ServerPrefix = $2; |