This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Discussion about merging Go frontend
- From: Ian Lance Taylor <iant at google dot com>
- To: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 02 Nov 2010 08:06:33 -0700
- Subject: Re: Discussion about merging Go frontend
- References: <mcr7hh8qhb5.fsf@google.com> <4CC45302.9000702@gmail.com> <mcrhbgbyoef.fsf@google.com> <4CC59F1E.7040505@codesourcery.com> <mcrbp6ixhny.fsf@google.com> <AANLkTikEy7ER+CkQdWo0XHPoBORvbp8JZ226QFM68PZv@mail.gmail.com> <87pquy3yh5.fsf@basil.nowhere.org> <4CC60C5E.6050605@gmail.com> <mcr1v79bx8q.fsf@google.com> <4CCBF722.5070507@gmail.com>
Dave Korn <dave.korn.cygwin@gmail.com> writes:
> +# Trying to get this information from gcc's config is tricky.
> +case $target in
> + x86_64*-mingw*)
> + SYM_STYLE=-DSYM_STYLE=ss_none
> + ;;
> + *-cygwin* | i?86*-mingw* )
> + SYM_STYLE=-DSYM_STYLE=ss_win32
> + ;;
> + *)
> + SYM_STYLE=-DSYM_STYLE=ss_none
> + ;;
> esac
> -
> -AC_SUBST(LTO_FORMAT)
> +AC_SUBST(SYM_STYLE)
It would seem more natural to use AC_DEFINE here. Any reason not to do
that?
> + else if (!strncmp (option, "-sym-style=", sizeof ("-sym-style=") - 1))
> + {
> + switch (option[sizeof ("-sym-style=")])
> + {
> + case 'w':
> + sym_style = ss_win32;
> + break;
> + case 'u':
> + sym_style = ss_uscore;
> + break;
> + default:
> + sym_style = ss_none;
> + break;
> + }
> + }
This looks wrong, because sizeof ("-sym-style=") will be 1 too large in
the switch clause.
And of course this code now has to use simple_object rather than
objfile.
Ian