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: Doing an abort for invalid va_arg type


Corey Minyard <minyard@acm.org> writes:

> I'm working on a situation where the compiler is producing an
> abort when passing a "char" into va_arg.
> 
> I know that the code is invalid, but this involves legacy systems.
> I would think it better to produce an error in this case, on the
> principle that bugs are cheaper to fix the sooner you find them.

The compiler used to do this, but it was pointed out that it's perfectly
legal C to use this construct, so long as it never gets executed.  Thus
the abort.

The compiler does always produce a warning.

...
> If that isn't acceptable, what about adding a flag to cause an
> error any time the compiler would produce an abort?

Have you tried -Werror?

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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