[Cfp-interest] syntax for alternate exception handing

Jim Thomas jaswthomas at sbcglobal.net
Wed Aug 13 09:28:41 PDT 2014


We need to get over this hump. I’m inclined toward staying with pragmas, at least for the first draft of Part 5. There seems to be no consensus on any syntax, including pragmas. However, we already use pragmas for other FP attributes. Strictly speaking, the pragmas we have can be ignored, but only if the most conservative behavior is provided by default, which it seldom if ever is. Pragmas do not involve adding new syntax to the language, which has some value in itself and also simplifies the job of specification. We can clearly express the required semantics using pragmas in the first draft, provide another document with a list of the other suggested syntaxes, and let WG 14, in committee meetings in October, decide if it wants us to add language extensions for one of the other syntaxes or stay with pragmas.

-Jim

On Jul 28, 2014, at 4:27 PM, David Hough CFP <pcfp at oakapple.net> wrote:

> 
> ON syntax
> 
> macros don't work, pragmas don't work, try/catch don't work, 
> attributes don't work... meaning that a majority or the C committee have
> bad feelings about them.
> 
> How about an ON exception syntax?     At least it's a keyword.
> I'd suggest allowing it whenever one of our #pragmas is allowed.
> 
> {
> #pragma STDC PROPERTY value
> 
> code
> }
> 
> becomes
> 
> {
> ON exceplist action value
> 
> code
> }
> 
> The most important action value pairs would be
> 
> fe_default
> fe_abrupt				# underflow only
> fe_substitute expression		# presubstitution
> fe_immediate label			# goto label
> fe_deferred label			# goto label
> 
> Another way to slice it would be to combine "on" and "action"
> into a number of keywords
> 
> fe_default
> fe_abrupt
> fe_substitute
> fe_immediate
> fe_deferred
> 
> e.g.
> 
> {
> fe_immediate exceplist label
> 
> code
> }
> 
> Since it's not a pragma it's clear that it's mandatory rather than
> permissive.
> 
> It could also be formulated in function or macro syntax but since
> it's not really a function or macro, I don't see that it buys anything.
> But maybe others would see it differently:
> 
> {
> fe_immediate(exceplist,label);
> 
> code
> }
> 
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list