Hi,
is somebody able to explain, why the follwoing code snippet doesn#t work
as expected when compiled with -m64 instead of -m32 (no matter, whether
on snv_b106 or S10u6 with StudioC 12)?
At least wrt. the original sources I can't spot the problem :(
#include <glib.h>
#include <stdio.h>
/**
cc -g -m64 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -lglib-2.0 \
bug.c -o bug
setenv G_DEBUG fatal_criticals
./bug
GLib-CRITICAL **: file gstring.c: line 1015: assertion `pos <= string->len'
failed
aborting...
g_string_sized_new
http://glib2.0.sourcearchive.com/documentation/2.18.3/gstring_8c-source.html#l00364
g_string_maybe_expand
http://glib2.0.sourcearchive.com/documentation/2.18.3/gstring_8c-source.html#l00353
nearest_power
http://glib2.0.sourcearchive.com/documentation/2.18.3/gstring_8c-source.html#l00107
g_string_append_c_inline
http://glib2.0.sourcearchive.com/documentation/2.18.3/gstring_8h-source.html#l00144
g_string_insert_c
http://glib2.0.sourcearchive.com/documentation/2.18.3/gstring_8c-source.html#01004
*/
int main(int argc, char **argv) {
GString* out;
out = g_string_sized_new(64);
printf("size=%d capacity=%d\n", out->len, out->allocated_len);
g_string_append_c(out,'x');
printf("%s\n", out->str);
}
--
Otto-von-Guericke University http://www.cs.uni-magdeburg.de/
Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany Tel: +49 391 67 12768
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code