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: [fixinc patch] Add disabled hacks from old fixincludes 2/5


Nathanael Nerode wrote:
> 
> Bruce, OK for mainline?  How's my sed expression look?
> 
>         * fixinc/inclhack.def (ptx_sys_mc_param_h): New disabled fix,
>         ported from fixinc.ptx.

Sed expressions are (mostly) write-only.  I don't see a test-text:

   test-text = <<_END_OF_TEST_
static inline void non_gnu( void )
{
__asm( "# non-GNU assembler code\n" );
}
_END_OF_TEST_;

make sure the result is what you want (omit the #ifdef and run a make check):

static inline void non_gnu( void ) {
#if !defined (__GNUC__) && !defined (__GNUG__)
__asm( "# non-GNU assembler code\n" );
#endif
}

> +#ifdef PTX
> +fix = {
> +    hackname = ptx_sys_mc_param_h;
> +    file     = sys/mc_param.h;
> +    sed      = "/__asm/,/}/{\n"
> +               "/__asm/i#if !defined (__GNUC__) && !defined (__GNUG__)\n"
> +               "/}/a#endif\n"
> +               "}";
> +};
> +#endif


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