gcc - Difference between '-std' and '--std' compiler flags -
i've noticed both -std
, --std
works setting standard compiling. difference between using -
, --
before std
?
i've googled , found this, doesn't seem mention single hyphen vs double hyphen before std
.
-std=c99
ok -std c99
error. --std c99
valid --std=c99
. that's difference.
you can see map same action in opts-common.c:
struct option_map { /* prefix of option on command line. */ const char *opt0; /* if 2 argv elements considered merged 1 option, prefix second element, otherwise null. */ const char *opt1; /* new prefix map to. */ const char *new_prefix; /* whether @ least 1 character needed following opt1 or opt0 mapping used. (--optimize= valid -o, --warn- not valid -w.) */ bool another_char_needed; /* whether original option negated form of option resulting map. */ bool negated; }; static const struct option_map option_map[] = { ... { "--std=", null, "-std=", false, false }, { "--std", "", "-std=", false, false }, ... };
Comments
Post a Comment