This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Repair __builtin_setjmp/__builtin_longjmp


> > (a) we should document it in the manual as something users can use (if
> > there are reasonable use cases), or
> >
> > (b) make it an error to call it from user code (if it doesn't make any
> > sense for users to use the function).
>
> I've changed my mind. :-) ?I don't see any real reasons why the builtins
> should not be exposed like all the other GCC builtins, they are not more
> exotic than them. ?All are hooks into the compiler and you're supposed to
> know what you're doing if you call them directly.

I disagree. A builtin function should either have well defined semantics that 
we can document and commit to preserving, or should never be used directly.

This is clearly the latter, and IMHO it's worth enforcing this where 
practical.  Users can and will abuse any "features" available to them. If we 
allow the user to call these builtins there should be user visible 
documentation that says "Don't ever use these".

>  (c) document briefly how they work in the sources of the compiler

This sounds to much like an undocumented extension for my liking.  Past 
experience has shown that these are a bad thing.

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]