This is the mail archive of the gcc@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]

Re: init_priority



> If I'm missing something obvious, someone please tell me.  What I have
> in mind is something like this patch (the #if conditionals are just
> placeholders):

Please don't warn about redundant -f options.

*Many* of the -f options are on by default, and no message is given to
the user if they include them.  This is a good thing, in general, because
the default value of -f switches is sometimes flipped by new versions
of the compiler.

Warning that -finit-priority won't work is a good thing, though.

> 
> Index: decl2.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
> retrieving revision 1.416
> diff -u -3 -p -r1.416 decl2.c
> --- decl2.c	2000/12/07 07:56:43	1.416
> +++ decl2.c	2000/12/21 20:29:28
> @@ -611,6 +611,11 @@ lang_decode_option (argc, argv)
>  	  flag_alt_external_templates = 1;
>            cp_deprecated ("-falt-external-templates");
>  	}
> +      else if (!strcmp (p, "init-priority")
> +               || !strcmp (p, "init-priority"))
> +        {
> +          warning ("-finit-priority is unneeded (it is on by default)");
> +        }
>        else if (! strcmp (p, "no-alt-external-templates"))
>  	flag_alt_external_templates = 0;
>        else if (!strcmp (p, "repo"))
> Index: tree.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
> retrieving revision 1.226
> diff -u -3 -p -r1.226 tree.c
> --- tree.c	2000/12/21 17:50:07	1.226
> +++ tree.c	2000/12/21 20:29:28
> @@ -2309,6 +2309,11 @@ cp_valid_lang_attribute (attr_name, attr
>  	  warning 
>  	    ("requested init_priority is reserved for internal use");
>  	}
> +#if ELF && !GNU_LD
> +      /* Ctor/dtor reordering under ELF without GNU ld is probably
> +         going to do very bad things. */
> +      warning ("using init_priority on this system without GNU ld may cause unexpected results");
> +#endif
>  
>        DECL_INIT_PRIORITY (decl) = pri;
>        return 1;
> 


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