[lug] [OT] g++ error message: declared with an exception specification?
rm at fabula.de
rm at fabula.de
Tue Nov 19 11:07:37 MST 2002
On Tue, Nov 19, 2002 at 10:30:50AM -0700, Scott Herod wrote:
>
> Hello,
>
> Sorry of the OT post, but this is about the best group of people for it.
>
> I'm trying to write a bash built-in and compile it with g++. This is with
> bash 2-05a source from the GNU folk. I'm getting errors like:
>
> ../GNU/bash-2.05a/general.h:187: `sh_intfunc_t' declared with an exception
> specification
Rather silly question: if you compile an extension to a C-Program, shouldn't
the exported functions be wrapped in 'extern C ...{ ...' ? Exception specification
smells pretty much like C++-Linking ....
ralfd
> where line 187 reads:
>
> typedef int sh_intfunc_t __P((int));
>
> and __P is defined with:
>
> #if !defined (__P)
> # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
> # define __P(protos) protos
> # else
> # define __P(protos) ()
> # endif
> #endif
>
> A test file (below) compiles just fine.
>
> ======================================================================
> #if !defined (__P)
> # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
> # define __P(protos) protos
> # else
> # define __P(protos) ()
> # endif
> #endif
>
>
> typedef int spam_is_good __P((int));
>
> typedef char* spuds_are_bad ();
> typedef int spam_spuds (int);
> ====================================================================
>
> Can anyone suggest a way for me to see what the compiler sees with the
> typedef lines? I suspect that __P must be redefined somewhere but can't
> find where.
>
> Thanks,
>
> Scott
>
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
More information about the LUG
mailing list