Open GoogleCodeExporter opened 9 years ago
Thanks for the report. I agree that a macro similar to the one you suggested
makes life easier. However, as the __attribute__ keyword is GCC specific, I
will look for a more general definition which will work also with other
compilers.
Original comment by andreas....@gmail.com
on 14 Jan 2013 at 2:46
[deleted comment]
[deleted comment]
[deleted comment]
Maybe introduce another registerer class is a better choice:
class FlagValidatorRegisterer {
public:
tempalate <typename T>
FlagValidatorRegisterer(const bool* flag,
bool (*validate_fn)(const char*, T)) {
success_ = RegisterFlagValidator(flag, validator_fn);
}
private:
bool success_;
};
#define GFLAGS_register_validator(name, validator) \
static FlagValidatorRegisterer
FLAGS_##name##_validator_registerer(&FLAGS_##name, validator)
Original comment by chen3feng
on 16 Jan 2013 at 6:26
"const bool* flag," should be "const T* flag,"
Original comment by chen3feng
on 29 Jan 2013 at 10:22
FLAGS_##name##_validator_registerer may be potential with other flags variable.
#define GFLAGS_register_validator(name, validator) \
static FlagValidatorRegisterer
GFLAGS_validator_registerer_##name(&FLAGS_##name, validator)
can resolve this problem, and all validator share the same prefix, make it easy
for grep.
Original comment by chen3feng
on 30 Jan 2013 at 3:00
Added a DEFINE_validator macro to the API.
Regarding the warning, I have not encountered such when compiling the unit
tests on a recent Ubuntu and Cygwin installation. This should of course be
verified yet that the issue is completely resolved before I will close it.
Original comment by andreas....@gmail.com
on 20 Mar 2014 at 3:29
Original comment by andreas....@gmail.com
on 20 Mar 2014 at 3:35
In my case, this warning only issued with compiling errors. thanks for
fixing.
2014-03-20 23:35 GMT+08:00 <gflags@googlecode.com>:
Original comment by chen3feng
on 21 Mar 2014 at 2:34
Only occurs with other compiling errors. if no other errors, nothing warned.
Original comment by chen3feng
on 21 Mar 2014 at 2:49
Original issue reported on code.google.com by
chen3feng
on 14 Jan 2013 at 10:33