diff options
author | Doug Kwan <dougkwan@google.com> | 2010-01-11 07:39:36 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2010-01-11 07:39:36 +0000 |
commit | e96c574bdc02a1bda4fc708ae5d2233e3385f0af (patch) | |
tree | 4c5a23eba1b8df66da346bd853cb302b7dbfa86c /gold | |
parent | ba4d53bf2b70e0c5adf55bd3e4f815651d372c14 (diff) | |
download | gdb-e96c574bdc02a1bda4fc708ae5d2233e3385f0af.zip gdb-e96c574bdc02a1bda4fc708ae5d2233e3385f0af.tar.gz gdb-e96c574bdc02a1bda4fc708ae5d2233e3385f0af.tar.bz2 |
2010-01-10 Doug Kwan <dougkwan@google.com>
* options.h (DEFINE_var): Use parentheses around argument varname__
in macro body to avoid any unintended subsequent substitutions.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 5 | ||||
-rw-r--r-- | gold/options.h | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index ddf5090..dd5688c 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2010-01-10 Doug Kwan <dougkwan@google.com> + + * options.h (DEFINE_var): Use parentheses around argument varname__ + in macro body to avoid any unintended subsequent substitutions. + 2010-01-10 Ian Lance Taylor <iant@google.com> * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR diff --git a/gold/options.h b/gold/options.h index b22060a..ab4a9e6 100644 --- a/gold/options.h +++ b/gold/options.h @@ -244,12 +244,18 @@ struct Struct_special : public Struct_var // var() and set_var() as General_options methods. Arguments as are // for the constructor for One_option. param_type__ is the same as // type__ for built-in types, and "const type__ &" otherwise. +// +// When we define the linker command option "assert", the macro argument +// varname__ of DEFINE_var below will be replaced by "assert". On Mac OSX +// assert.h is included implicitly by one of the library headers we use. To +// avoid unintended macro substitution of "assert()", we need to enclose +// varname__ with parenthese. #define DEFINE_var(varname__, dashes__, shortname__, default_value__, \ default_value_as_string__, helpstring__, helparg__, \ optional_arg__, type__, param_type__, parse_fn__) \ public: \ param_type__ \ - varname__() const \ + (varname__)() const \ { return this->varname__##_.value; } \ \ bool \ |