[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Remove error procedure directives
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] Remove error procedure directives |
Date: |
Sat, 17 Jun 2023 22:58:35 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Applied, thanks!
Sergey Bugaev, le sam. 17 juin 2023 23:39:53 +0300, a ecrit:
> 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.
> ---
> global.c | 1 -
> global.h | 1 -
> lexxer.l | 1 -
> parser.y | 10 ----------
> 4 files changed, 13 deletions(-)
>
> diff --git a/global.c b/global.c
> index 96c493e..0ef1dca 100644
> --- a/global.c
> +++ b/global.c
> @@ -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;
> diff --git a/global.h b/global.h
> index e3d42dd..1b7be96 100644
> --- a/global.h
> +++ b/global.h
> @@ -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;
> diff --git a/lexxer.l b/lexxer.l
> index 508603a..6e2234e 100644
> --- a/lexxer.l
> +++ b/lexxer.l
> @@ -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);
> diff --git a/parser.y b/parser.y
> index ccf4726..cac3379 100644
> --- a/parser.y
> +++ b/parser.y
> @@ -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;
> --
> 2.41.0
>
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.