Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Getting sensible information from gdb Date: Sun, 11 Oct 2015 18:56:11 -0700 Organization: None to speak of Lines: 26 Message-ID: References: <8nol1bd6nelrp297hgfcojvubqfth6hfd1@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="24463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BkgI2QuPI55gxr96P7O2H" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:VPNWFbxCmbykc1f6IZ7d/cvCTXw= sha1:gAIu8woXFbwKADoeSBPZFSt/uvQ= Xref: csiph.com comp.lang.c:72548 James Kuyper writes: > On 10/11/2015 07:15 PM, Geoff wrote: > ... >> Or more simply use: >> printf("Error not handled in function: %s \n", __FUNCTION__, >> __FILE__); >> >> This is C90 compliant and consistent with your project. You can >> annotate this with a comment that you're coming back to it later. > > Unlike __FILE__, __FUNCTION__ is not one the identifiers that the C > standard requires an implementation to pre#define, nor is it an > identifier that the user has permission to define, not in any context. > __func__ was added in C99, is that what you were thinking of? If > __FUNCTION__ is a compiler-specific extension to C, you should identify > at least one of the compilers that supports it. __FUNCTION__ is a gcc extension, equivalent to __func__. The gcc documention mentions that older versions of gcc recognize __FUNCTION__ but not __func__, but recommends using __func__. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"