On Mon, Jul 11, 2016 at 9:58 PM, Marek Polacek <[email protected]> wrote:
> 2016-07-11 Marek Polacek <[email protected]>
>
> PR c/7652
> * lto-plugin.c (lto_fallthrough): Define.
> (parse_table_entry): Use it.
>
> diff --git gcc/lto-plugin/lto-plugin.c gcc/lto-plugin/lto-plugin.c
> index 51afc52..ffdf54a 100644
> --- gcc/lto-plugin/lto-plugin.c
> +++ gcc/lto-plugin/lto-plugin.c
> @@ -77,6 +77,12 @@ along with this program; see the file COPYING3. If not see
> # define O_BINARY 0
> #endif
>
> +#if __GNUC__ >= 7
> +# define lto_fallthrough() __builtin_fallthrough ()
> +#else
> +# define lto_fallthrough()
> +#endif
> +
> /* Segment name for LTO sections. This is only used for Mach-O.
> FIXME: This needs to be kept in sync with darwin.c. */
>
> @@ -254,6 +260,7 @@ parse_table_entry (char *p, struct ld_plugin_symbol
> *entry,
> break;
> }
> /* FALL-THROUGH. */
> + lto_fallthrough ();
This shows me that it would be nice to simply get this correct by
parsing comments...
I don't like __builtin_fallthrough () too much.
Richard.
> case ss_uscore:
> entry->name = concat ("_", p, NULL);
> break;