(struct cl_decoded_option): Add warn_message field.
* doc/options.texi (Ignore, Warn): Document.
* opt-functions.awk (needs_state_p): Don't consider aliases or
ignored options to need state saved.
* optc-gen.awk: Handle Warn and Ignore.
* opth-gen.awk: Output OPT_SPECIAL_ignore.
* opts-common.c (decode_cmdline_option): Set warn_message field.
Handle ignored options.
(decode_cmdline_options_to_array, generate_option,
generate_option_input_file): Set warn_message field.
(read_cmdline_option): Generate warnings from warn_message field.
Handle ignored options.
* common.opt (Wunreachable-code, fargument-alias,
fargument-noalias, fargument-noalias-global,
fargument-noalias-anything, fcse-skip-blocks, fforce-addr,
floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee,
fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop,
ftree-salias): Mark Ignore.
* config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu,
-mintel-syntax and -mno-intel-syntax here.
* config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases
using Warn.
* opts.c (common_handle_option): Don't handle options marked as
ignored.
(enable_warning_as_error): Handle ignored options.
c-family:
* c.opt (Wimport, fall-virtual, falt-external-templates,
fdefault-inline, fenum-int-equiv, fexternal-templates,
fguiding-decls, fhonor-std, fhuge-objects, flabels-ok,
fname-mangling-version-, fnew-abi, fnonnull-objects,
foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable,
fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as
applicable.
(fhandle-exceptions): Mark with Alias and Warn.
* c-opts.c (c_common_handle_option): Don't handle options marked
as ignored.
po:
* exgettext: Handle {} in operand of MissingArgError. Handle
Warn.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163771
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-09-02 Joseph Myers <joseph@codesourcery.com>
+ * opts.h (struct cl_option): Add warn_message field.
+ (struct cl_decoded_option): Add warn_message field.
+ * doc/options.texi (Ignore, Warn): Document.
+ * opt-functions.awk (needs_state_p): Don't consider aliases or
+ ignored options to need state saved.
+ * optc-gen.awk: Handle Warn and Ignore.
+ * opth-gen.awk: Output OPT_SPECIAL_ignore.
+ * opts-common.c (decode_cmdline_option): Set warn_message field.
+ Handle ignored options.
+ (decode_cmdline_options_to_array, generate_option,
+ generate_option_input_file): Set warn_message field.
+ (read_cmdline_option): Generate warnings from warn_message field.
+ Handle ignored options.
+ * common.opt (Wunreachable-code, fargument-alias,
+ fargument-noalias, fargument-noalias-global,
+ fargument-noalias-anything, fcse-skip-blocks, fforce-addr,
+ floop-optimize, frerun-loop-opt, fsched2-use-traces, fsee,
+ fstrength-reduce, ftree-store-ccp, ftree-store-copy-prop,
+ ftree-salias): Mark Ignore.
+ * config/i386/i386.h (CC1_CPU_SPEC_1): Don't handle -mcpu,
+ -mintel-syntax and -mno-intel-syntax here.
+ * config/i386/i386.opt (mcpu=, mintel-syntax): Define as aliases
+ using Warn.
+ * opts.c (common_handle_option): Don't handle options marked as
+ ignored.
+ (enable_warning_as_error): Handle ignored options.
+
+2010-09-02 Joseph Myers <joseph@codesourcery.com>
+
PR driver/44076
* opts.h (struct cl_option): Add alias_arg, neg_alias_arg and
alias_target fields.
2010-09-02 Joseph Myers <joseph@codesourcery.com>
+ * c.opt (Wimport, fall-virtual, falt-external-templates,
+ fdefault-inline, fenum-int-equiv, fexternal-templates,
+ fguiding-decls, fhonor-std, fhuge-objects, flabels-ok,
+ fname-mangling-version-, fnew-abi, fnonnull-objects,
+ foptional-diags, fsquangle, fstrict-prototype, fthis-is-variable,
+ fvtable-gc, fvtable-thunks, fxref): Mark with Ignore and Warn as
+ applicable.
+ (fhandle-exceptions): Mark with Alias and Warn.
+ * c-opts.c (c_common_handle_option): Don't handle options marked
+ as ignored.
+
+2010-09-02 Joseph Myers <joseph@codesourcery.com>
+
* c.opt (Wcomments, Werror-implicit-function-declaration,
ftemplate-depth-, std=c89, std=c9x, std=gnu89, std=gnu9x,
std=iso9899:1990, std=iso9899:1999, std=iso9899:199x): Mark as
value, c_family_lang_mask, kind, handlers);
break;
- case OPT_Wimport:
- /* Silently ignore for now. */
- break;
-
case OPT_Winvalid_pch:
cpp_opts->warn_invalid_pch = value;
break;
flag_cond_mismatch = value;
break;
}
- /* Fall through. */
-
- case OPT_fall_virtual:
- case OPT_falt_external_templates:
- case OPT_fenum_int_equiv:
- case OPT_fexternal_templates:
- case OPT_fguiding_decls:
- case OPT_fhonor_std:
- case OPT_fhuge_objects:
- case OPT_flabels_ok:
- case OPT_fname_mangling_version_:
- case OPT_fnew_abi:
- case OPT_fnonnull_objects:
- case OPT_fsquangle:
- case OPT_fstrict_prototype:
- case OPT_fthis_is_variable:
- case OPT_fvtable_thunks:
- case OPT_fxref:
- case OPT_fvtable_gc:
warning (0, "switch %qs is no longer supported", option->opt_text);
break;
constant_string_class_name = arg;
break;
- case OPT_fdefault_inline:
- /* Ignore. */
- break;
-
case OPT_fextended_identifiers:
cpp_opts->extended_identifiers = value;
break;
flag_next_runtime = !value;
break;
- case OPT_fhandle_exceptions:
- warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)");
- flag_exceptions = value;
- break;
-
case OPT_fnext_runtime:
flag_next_runtime = value;
break;
cpp_opts->operator_names = value;
break;
- case OPT_foptional_diags:
- /* Ignore. */
- break;
-
case OPT_fpch_deps:
cpp_opts->restore_pch_deps = value;
break;
Warn when a declaration does not specify a type
Wimport
-C ObjC C++ ObjC++ Undocumented
+C ObjC C++ ObjC++ Undocumented Ignore
Wint-to-pointer-cast
C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning
Enforce class member access control semantics
fall-virtual
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
falt-external-templates
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Change when template instances are emitted
fasm
-fno-deduce-init-list disable deduction of std::initializer_list for a template type parameter from a brace-enclosed initializer-list
fdefault-inline
-C++ ObjC++
+C++ ObjC++ Ignore
Does nothing. Preserved for backward compatibility.
fdirectives-only
Generate code to check exception specifications
fenum-int-equiv
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fexec-charset=
C ObjC C++ ObjC++ Joined RejectNegative
fexternal-templates
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
ffor-scope
C++ ObjC++ Var(flag_new_for_scope) Init(1)
Use traditional GNU semantics for inline functions
fguiding-decls
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fhandle-exceptions
-C++ ObjC++ Optimization
+C++ ObjC++ Optimization Alias(fexceptions) Warn({-fhandle-exceptions has been renamed -fexceptions (and is now on by default)})
fhonor-std
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fhosted
C ObjC
Assume normal C execution environment
fhuge-objects
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Enable support for huge objects
fimplement-inlines
Inject friend functions into enclosing namespace
flabels-ok
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
flax-vector-conversions
C ObjC C++ ObjC++ Var(flag_lax_vector_conversions)
Don't warn about uses of Microsoft extensions
fname-mangling-version-
-C++ ObjC++ Joined
+C++ ObjC++ Joined Ignore Warn(switch %qs is no longer supported)
fnew-abi
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fnext-runtime
ObjC ObjC++
C++ ObjC++ Var(flag_no_nonansi_builtin, 0)
fnonnull-objects
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fnothrow-opt
C++ ObjC++ Optimization Var(flag_nothrow_opt)
Recognize C++ keywords like \"compl\" and \"xor\"
foptional-diags
-C++ ObjC++
+C++ ObjC++ Ignore
Does nothing. Preserved for backward compatibility.
fpch-deps
Make \"char\" signed by default
fsquangle
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fstats
C++ ObjC++ Var(flag_detailed_statistics)
Assume that values of enumeration type are always within the minimum range of that type
fstrict-prototype
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
ftabstop=
C ObjC C++ ObjC++ Joined RejectNegative UInteger
-ftemplate-depth=<number> Specify maximum template instantiation depth
fthis-is-variable
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
fthreadsafe-statics
C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1)
Changes visibility to match Microsoft Visual Studio by default
fvtable-gc
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Discard unused virtual functions
fvtable-thunks
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Implement vtables using thunks
fweak
Generate a #line directive pointing at the current working directory
fxref
-C++ ObjC++
+C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Emit cross referencing information
fzero-link
Warn about uninitialized automatic variables
Wunreachable-code
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
Wunused
Common RejectNegative Joined UInteger
fargument-alias
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fargument-noalias
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fargument-noalias-global
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fargument-noalias-anything
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fasynchronous-unwind-tables
When running CSE, follow jumps to their targets
fcse-skip-blocks
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fcx-limited-range
Don't allocate floats and doubles in extended-precision registers
fforce-addr
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fforward-propagate
Give external symbols a leading underscore
floop-optimize
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
flto
Add a common subexpression elimination pass after loop optimizations
frerun-loop-opt
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
frounding-math
If scheduling post reload, do superblock scheduling
fsched2-use-traces
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fschedule-insns
Access data in the same section from shared anchor points
fsee
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
fzee
Output stack usage information on a per-function basis
fstrength-reduce
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
; Nonzero if we should do (language-dependent) alias analysis.
Enable SSA-BIT-CCP optimization on trees
ftree-store-ccp
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
ftree-ch
Enable copy propagation on trees
ftree-store-copy-prop
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
ftree-cselim
Enable reassociation on tree level
ftree-salias
-Common
+Common Ignore
Does nothing. Preserved for backward compatibility.
ftree-sink
#ifndef CC1_CPU_SPEC
#define CC1_CPU_SPEC_1 "\
-%{mcpu=*:-mtune=%* \
-%n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.\n} \
-%<mcpu=* \
-%{mintel-syntax:-masm=intel \
-%n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.\n} \
%{msse5:-mavx \
-%n'-msse5' was removed.\n} \
-%{mno-intel-syntax:-masm=att \
-%n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.\n}"
+%n'-msse5' was removed.\n}"
#ifndef HAVE_LOCAL_CPU_DETECT
#define CC1_CPU_SPEC CC1_CPU_SPEC_1
; Options for the IA-32 and AMD64 ports of the compiler.
-; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2006, 2007, 2008, 2009,
+; 2010 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
Target RejectNegative Joined Var(ix86_cmodel_string)
Use given x86-64 code model
+mcpu=
+Target RejectNegative Joined Undocumented Alias(mtune=) Warn(%<-mcpu=%> is deprecated; use %<-mtune=%> or %<-march=%> instead)
+
mfancy-math-387
Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) Save
Generate sin, cos, sqrt for FPU
Inline memset/memcpy string operations, but perform inline version only for small blocks
mintel-syntax
-Target Undocumented
+Target Undocumented Alias(masm=, intel, att) Warn(%<-mintel-syntax%> and %<-mno-intel-syntax%> are deprecated; use %<-masm=intel%> and %<-masm=att%> instead)
;; Deprecated
mms-bitfields
for it; only the canonical form of the option will be seen in those
places.
+@item Ignore
+This option is ignored apart from printing any warning specified using
+@code{Warn}. The option will not be seen by specs and no @samp{OPT_}
+enumeration value is defined for it.
+
+@item Warn(@var{message})
+If this option is used, output the warning @var{message}.
+@var{message} is a format string, either taking a single operand with
+a @samp{%qs} format which is the option name, or not taking any
+operands, which is passed to the @samp{warning} function. If an alias
+is marked @code{Warn}, the target of the alias must not also be marked
+@code{Warn}.
+
@item Report
The state of the option should be printed by @option{-fverbose-asm}.
# associated with it.
function needs_state_p(flags)
{
- return flag_set_p("Target", flags)
+ return (flag_set_p("Target", flags) \
+ && !flag_set_p("Alias.*", flags) \
+ && !flag_set_p("Ignore", flags))
}
# If FLAGS describes an option that needs a static state variable,
else
missing_arg_error = quote missing_arg_error quote
+
+ warn_message = opt_args("Warn", flags[i])
+ if (warn_message == "")
+ warn_message = "0"
+ else
+ warn_message = quote warn_message quote
+
alias_arg = opt_args("Alias", flags[i])
if (alias_arg == "") {
- alias_data = "NULL, NULL, N_OPTS"
+ if (flag_set_p("Ignore", flags[i]))
+ alias_data = "NULL, NULL, OPT_SPECIAL_ignore"
+ else
+ alias_data = "NULL, NULL, N_OPTS"
} else {
alias_opt = nth_arg(0, alias_arg)
alias_posarg = nth_arg(1, alias_arg)
}
# Split the printf after %u to work around an ia64-hp-hpux11.23
# awk bug.
- printf(" { %c-%s%c,\n %s,\n %s,\n %s, %s, %u,",
- quote, opts[i], quote, hlp, missing_arg_error,
+ printf(" { %c-%s%c,\n %s,\n %s,\n %s,\n %s, %s, %u,",
+ quote, opts[i], quote, hlp, missing_arg_error, warn_message,
alias_data, back_chain[i], len)
printf(" %d,\n", idx)
condition = opt_args("Condition", flags[i])
print " N_OPTS,"
print " OPT_SPECIAL_unknown,"
+print " OPT_SPECIAL_ignore,"
print " OPT_SPECIAL_program_name,"
print " OPT_SPECIAL_input_file"
print "};"
char *p;
const struct cl_option *option;
int errors = 0;
+ const char *warn_message = NULL;
bool separate_arg_flag;
bool joined_arg_flag;
goto done;
}
+ warn_message = option->warn_message;
+
/* Check to see if the option is disabled for this configuration. */
if (option->flags & CL_DISABLED)
errors |= CL_ERR_DISABLED;
if (arg == NULL && (separate_arg_flag || joined_arg_flag))
errors |= CL_ERR_MISSING_ARG;
- /* Is this option an alias? */
+ /* Is this option an alias (or an ignored option, marked as an alias
+ of OPT_SPECIAL_ignore)? */
if (option->alias_target != N_OPTS)
{
size_t new_opt_index = option->alias_target;
- const struct cl_option *new_option = &cl_options[new_opt_index];
-
- /* The new option must not be an alias itself. */
- gcc_assert (new_option->alias_target == N_OPTS);
- if (option->neg_alias_arg)
+ if (new_opt_index == OPT_SPECIAL_ignore)
{
- gcc_assert (option->alias_arg != NULL);
- gcc_assert (arg == NULL);
- if (value)
- arg = option->alias_arg;
- else
- arg = option->neg_alias_arg;
+ gcc_assert (option->alias_arg == NULL);
+ gcc_assert (option->neg_alias_arg == NULL);
+ opt_index = new_opt_index;
+ arg = NULL;
value = 1;
}
- else if (option->alias_arg)
+ else
{
- gcc_assert (value == 1);
- gcc_assert (arg == NULL);
- arg = option->alias_arg;
- }
+ const struct cl_option *new_option = &cl_options[new_opt_index];
- opt_index = new_opt_index;
- option = new_option;
+ /* The new option must not be an alias itself. */
+ gcc_assert (new_option->alias_target == N_OPTS);
- if (value == 0)
- gcc_assert (!(option->flags & CL_REJECT_NEGATIVE));
+ if (option->neg_alias_arg)
+ {
+ gcc_assert (option->alias_arg != NULL);
+ gcc_assert (arg == NULL);
+ if (value)
+ arg = option->alias_arg;
+ else
+ arg = option->neg_alias_arg;
+ value = 1;
+ }
+ else if (option->alias_arg)
+ {
+ gcc_assert (value == 1);
+ gcc_assert (arg == NULL);
+ arg = option->alias_arg;
+ }
- /* Recompute what arguments are allowed. */
- separate_arg_flag = ((option->flags & CL_SEPARATE)
- && !((option->flags & CL_NO_DRIVER_ARG)
- && (lang_mask & CL_DRIVER)));
- joined_arg_flag = (option->flags & CL_JOINED) != 0;
+ opt_index = new_opt_index;
+ option = new_option;
- if (!(errors & CL_ERR_MISSING_ARG))
- {
- if (separate_arg_flag || joined_arg_flag)
- gcc_assert (arg != NULL);
- else
- gcc_assert (arg == NULL);
- }
+ if (value == 0)
+ gcc_assert (!(option->flags & CL_REJECT_NEGATIVE));
+
+ /* Recompute what arguments are allowed. */
+ separate_arg_flag = ((option->flags & CL_SEPARATE)
+ && !((option->flags & CL_NO_DRIVER_ARG)
+ && (lang_mask & CL_DRIVER)));
+ joined_arg_flag = (option->flags & CL_JOINED) != 0;
+
+ if (!(errors & CL_ERR_MISSING_ARG))
+ {
+ if (separate_arg_flag || joined_arg_flag)
+ gcc_assert (arg != NULL);
+ else
+ gcc_assert (arg == NULL);
+ }
- /* Recheck for disabled options. */
- if (option->flags & CL_DISABLED)
- errors |= CL_ERR_DISABLED;
+ /* Recheck for warnings and disabled options. */
+ if (option->warn_message)
+ {
+ gcc_assert (warn_message == NULL);
+ warn_message = option->warn_message;
+ }
+ if (option->flags & CL_DISABLED)
+ errors |= CL_ERR_DISABLED;
+ }
}
/* Check if this is a switch for a different front end. */
decoded->arg = arg;
decoded->value = value;
decoded->errors = errors;
+ decoded->warn_message = warn_message;
if (opt_index == OPT_SPECIAL_unknown)
{
else
decoded->canonical_option[i] = NULL;
}
- if (opt_index != OPT_SPECIAL_unknown)
+ if (opt_index != OPT_SPECIAL_unknown && opt_index != OPT_SPECIAL_ignore)
generate_canonical_option (opt_index, arg, value, decoded);
decoded->orig_option_with_args_text = p = XNEWVEC (char, total_len);
for (i = 0; i < result; i++)
opt_array = XNEWVEC (struct cl_decoded_option, argc);
opt_array[0].opt_index = OPT_SPECIAL_program_name;
+ opt_array[0].warn_message = NULL;
opt_array[0].arg = argv[0];
opt_array[0].orig_option_with_args_text = argv[0];
opt_array[0].canonical_option_num_elements = 1;
const struct cl_option *option = &cl_options[opt_index];
decoded->opt_index = opt_index;
+ decoded->warn_message = NULL;
decoded->arg = arg;
decoded->value = value;
decoded->errors = (option_ok_for_language (option, lang_mask)
struct cl_decoded_option *decoded)
{
decoded->opt_index = OPT_SPECIAL_input_file;
+ decoded->warn_message = NULL;
decoded->arg = file;
decoded->orig_option_with_args_text = file;
decoded->canonical_option_num_elements = 1;
const struct cl_option_handlers *handlers)
{
const struct cl_option *option;
- const char *opt;
+ const char *opt = decoded->orig_option_with_args_text;
+
+ if (decoded->warn_message)
+ warning (0, decoded->warn_message, opt);
if (decoded->opt_index == OPT_SPECIAL_unknown)
{
return;
}
+ if (decoded->opt_index == OPT_SPECIAL_ignore)
+ return;
+
option = &cl_options[decoded->opt_index];
- opt = decoded->orig_option_with_args_text;
if (decoded->errors & CL_ERR_DISABLED)
{
global_dc->inhibit_warnings = true;
break;
- case OPT_fsee:
- case OPT_fcse_skip_blocks:
- case OPT_floop_optimize:
- case OPT_frerun_loop_opt:
- case OPT_fsched2_use_traces:
- case OPT_fstrength_reduce:
- case OPT_ftree_store_copy_prop:
- case OPT_fforce_addr:
- case OPT_ftree_salias:
- case OPT_ftree_store_ccp:
- case OPT_Wunreachable_code:
- case OPT_fargument_alias:
- case OPT_fargument_noalias:
- case OPT_fargument_noalias_anything:
- case OPT_fargument_noalias_global:
- /* These are no-ops, preserved for backward compatibility. */
- break;
-
case OPT_fuse_linker_plugin:
/* No-op. Used by the driver and passed to us because it starts with f.*/
break;
if (option->alias_target != N_OPTS)
option_index = option->alias_target;
+ if (option_index == OPT_SPECIAL_ignore)
+ return;
diagnostic_classify_diagnostic (global_dc, option_index, kind,
UNKNOWN_LOCATION);
if (kind == DK_ERROR)
const char *opt_text;
const char *help;
const char *missing_argument_error;
+ const char *warn_message;
const char *alias_arg;
const char *neg_alias_arg;
unsigned short alias_target;
non-options and unknown options. */
size_t opt_index;
+ /* Any warning to give for use of this option, or NULL if none. */
+ const char *warn_message;
+
/* The string argument, or NULL if none. For OPT_SPECIAL_* cases,
the option or non-option command-line argument. */
const char *arg;
+2010-09-02 Joseph Myers <joseph@codesourcery.com>
+
+ * exgettext: Handle {} in operand of MissingArgError. Handle
+ Warn.
+
2010-07-27 Joseph Myers <joseph@codesourcery.com>
* exgettext: Also extract MissingArgError texts from .opt files.
if ((field == 1) && /MissingArgError/) {
line = $0
sub(".*MissingArgError\\(", "", line)
- sub("\\).*", "", line)
+ if (line ~ "^{") {
+ sub("^{", "", line)
+ sub("}\\).*", "", line)
+ } else
+ sub("\\).*", "", line)
+ printf("#line %d \"%s\"\n", lineno, file)
+ printf("_(\"%s\")\n", line)
+ }
+ if ((field == 1) && /Warn/) {
+ line = $0
+ sub(".*Warn\\(", "", line)
+ if (line ~ "^{") {
+ sub("^{", "", line)
+ sub("}\\).*", "", line)
+ } else
+ sub("\\).*", "", line)
printf("#line %d \"%s\"\n", lineno, file)
printf("_(\"%s\")\n", line)
}