X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/56beb0d2b20edc2f0ac8716c020053f8a103577d..3e833eea9cb9822f04c639e143212c4b6f7940d4:/src/str_test.c diff --git a/src/str_test.c b/src/str_test.c new file mode 100644 index 0000000..12a1be9 --- /dev/null +++ b/src/str_test.c @@ -0,0 +1,20 @@ +#include "str.h" + +int +main (void) +{ + g_type_init (); + + int the_answer = 42; + char *stupid_pointer = "ug"; + + // This works fine. + Str *test_good = (Str *) (str_new ("%d", the_answer)); + test_good = test_good; + + // This gets a warning thanks to our function attribute. + Str *test_bad = (Str *) (str_new ("%d", stupid_pointer)); + test_bad = test_bad; + + return 0; +}