[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regex cannot be compiled with g++
From: |
Sam Steingold |
Subject: |
Re: regex cannot be compiled with g++ |
Date: |
Thu, 18 Oct 2007 21:57:11 -0400 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070719) |
Paul Eggert wrote:
That problem arises because for some reason glibc prefers old-style
function definitions when defining external functions meant to be
called from C code. Does anyone know why that is? I assume it's some
API thing.
Sounds highly improbable.
I thought that the function definition style is just some syntactic
sugar which cannot affect the way it is compiled.
- dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
+ dfa->state_table = (re_state_table_entry*)
+ calloc (sizeof (struct re_state_table_entry), table_size);
I dunno, it looks to me like a cure that is worse than the disease.
why?
this is the standard way to handle calloc/malloc/alloca.
Can't you arrange to compile that function using gcc rather than g++?
well, yes, I guess I can arrange for the gllib to be compiled with gcc.
more work for me - but what for?
why not just apply the patch?
I think there is some value in making gllib compilable with g++: better
type checking for gllib maintainers and ease of maintenance for gllib users.
Sam.