On 2012-10-14 23:44, Jakub Jelinek wrote:
On Mon, Oct 15, 2012 at 12:35:27AM +0300, Janne Blomqvist wrote:
On Sat, Oct 13, 2012 at 4:26 PM, Tobias Schlüter
I'm putting forward two patches. One uses a C++ map to very concisely build
up and handle the ordered list of symbols. This has three problems:
1) gfortran maintainers may not want C++isms (even though in this case
it's very localized, and in my opinion very transparent), and
Even if you prefer a C++isms, why don't you go for "hash-table.h"?
std::map at least with the default allocator will just crash the compiler
if malloc returns NULL (remember that we build with -fno-exceptions),
while when you use hash-table.h (or hashtab.h) you get proper OOM diagnostics.
I wasn't aware of the OOM problem. Couldn't gcc install a default
memory handler that gives the correct diagnostics? That certainly
sounds like the most sensible solution, but I don't know if it's possible.
From looking over hash-table.h, I dislike two feature about it, one
aesthetical, one practical: 1) I need to use a callback function during
the iteration, which is less transparent than the for() loop and 2) I
can't read from the comments whether traversal is ordered (I don't think
it is, but ordered traversal is the whole point of my patch).
Cheers,
- Tobi