> If we change the default of -xstrconst to be on, if your code modifies
> a string literal (gasp!), you can recover by using the new option
> -features=no%conststrings. But the option -features=no%conststrings
> does not exist in Sun Studio 12. Thus you cannot switch between
> Sun Studio 12 cc and the next version of Sun Studio cc, without
> also adding/removing -features=no%conststrings. So, to avoid
> that issue, we intend on patching Sun Studio 12 to add
> -features=no%conststrings.
A few thoughts:
* This seems less severe than the -m64 case, in that correct code
will not need -features=no%conststrings and thus the warning
issue is sidestepped.
* To avoid this sort of problem going forward, it seems like a
general rule is needed that every feature must have an explicit
way to enable *and* disable it (rather than piggybacking on a
"default" semantic to provide it). This will also allow careful
developers to be explicit about their requirements rather than
relying on default values that may change with time and break
them.
* There seems to be an implied rule that option compatibility is
provided for one release (otherwise, it seems patches for
Studio 11 and earlier would also be needed). That seems to just
postpone the inevitable since we'll still end up with each
upgrade possibly leading to a warning (the only difference being
that it'll be for a Studio N-2 feature rather than a Studio N-1
feature).
--
meem