File: str_test.c

package info (click to toggle)
gob2 2.0.17-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,564 kB
  • ctags: 1,406
  • sloc: ansic: 5,133; yacc: 2,023; sh: 1,156; lex: 623; perl: 431; makefile: 69
file content (20 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
}