API : constness ?

Andreas Kostyrka andreas at kostyrka.org
Mon May 31 08:13:19 EDT 2004


Am Mo, den 31.05.2004 schrieb Benoît Dejean um 03:26:
> it's also for a simple reason, eg using PyArg_ParseTupleAndKeywords
> 
> using const helps gcc to move these data to the text segment
Don't think so. At least not if you are compiling without
-traditional or -fwritable-strings:
andreas at andi-lap:~> cat t.c
main() {
  char *x = "ABC";
  x[0] = 'D';
}
andreas at andi-lap:~> gcc -fwritable-strings -o t t.c
andreas at andi-lap:~> ./t
andreas at andi-lap:~> gcc -o t t.c
andreas at andi-lap:~> ./t
Speicherzugriffsfehler
andreas at andi-lap:~>

Andreas





More information about the Python-list mailing list