This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help restricting args of an intrinsic function


On Monday, February 2, 2004, at 03:45 PM, Joe Buck wrote:
So issue a warning, and make the warning suppressible.  If you don't,
you'll then be in the position of telling people to use #define instead
of const,

? I don't see that that follows. Syd intends on making const int i = 5 work. If he does that, then there is not need to tell people to use #define instead of const int i = 5.


and you'll saddle us with a huge stream of additional bugs
(any time the compiler changes in such a way that an expression that
used to be simplified to a constant at -O0 isn't, we get a bug report).

Again, I don't see that this follows:


const int ci = 5;
class A {
public:
  static const int sci = 5;
  static char a1[sci];
} a;

char A::a1[sci];

int a1[ci];
int a2[A::sci];

is valid code that already must work, and work is defined to be knowing that size of the arrays at compile time.

Syd needs nothing more. Since this is already implemented, already works, and already is maintained, I don't see this as a maintenance burden. The only issue is how best to hook into it.

Also, Syd has a wonderfully extensive testsuite. It just won't be possible to break this for more than 24 hours without Geoff's tester complaining.

Also, I failed to mention that generating a warning and having the fallback code would be lots more work and be error prone, it doesn't _just_ violate the users expectations.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]