Re: hypenator.cc errors

"Sebastian Geerken" <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
> > [...]
> 
> Thinking about it again, variable length arrays are a feature of C,
> but not of C++, although it seems that most C++ compilers support it.
> Since this is a nice feature, but standard C++ should be supported,
> I've thought of testing it by the configure script, and then hide two
> different implementations behind a macro. See attached patch, which
> should be applied to the current hg repository.
> 
> What do you think? [...]

Third round: I agree with Jorge that this is quite too complex; and
profiling shows no performance gain of using the heap over using the
stack, so I've replaced it by new and delete. Cris: please test the
latest version from hg, it should compile now.

I've tried to force g++ to raise an error in this case, by using this
example:

---
#include <stdlib.h>

int main()
{
   int n = rand() % 10 + 1;
   char c[n];
}
---

but both "g++ -std=c++98 test.cc" and "g++ -std=c++11 test.cc" do not
complain. Does someone have an idea? ("g++ --version" => "g++ (Debian
4.7.2-5) 4.7.2")

Sebastian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.