1 $DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/c-format.c.patch,v 1.2 2004/12/21 13:10:48 joerg Exp $
3 ===================================================================
4 RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/gcc-3.4/gcc/c-format.c,v
5 retrieving revision 1.1
6 diff -u -r1.1 c-format.c
7 --- c-format.c 20 Jun 2004 02:14:48 -0000 1.1
8 +++ c-format.c 20 Dec 2004 20:48:08 -0000
10 { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" },
11 /* GNU conversion specifiers. */
12 { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
13 + /* BSD conversion specifiers. */
14 + /* DragonFly kernel extensions (src/sys/kern/subr_prf.c).
15 + The format %b is supported to decode error registers.
16 + Its usage is: printf("reg=%b\n", regval, "<base><arg>*");
17 + which produces: reg=3<BITTWO,BITONE>
18 + The format %D provides a hexdump given a pointer and separator string:
19 + ("%6D", ptr, ":") -> XX:XX:XX:XX:XX:XX
20 + ("%*D", len, ptr, " ") -> XX XX XX XX ...
22 + { "D", 1, STD_EXT, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
23 + { "b", 1, STD_EXT, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
24 + { "ry", 0, STD_EXT, { T89_I, BADLEN, BADLEN, T89_L, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "i" },
25 + { "z", 0, STD_EXT, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" },
26 { NULL, 0, 0, NOLENGTHS, NULL, NULL }
29 @@ -1998,6 +2011,57 @@
33 + if (*format_chars == 'b')
35 + /* There should be an int arg to control the string arg. */
38 + status_warning (status, "too few arguments for format");
41 + if (info->first_arg_num != 0)
43 + cur_param = TREE_VALUE (params);
44 + params = TREE_CHAIN (params);
46 + if ((TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
47 + != integer_type_node)
49 + (TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
50 + != unsigned_type_node))
52 + status_warning (status, "bitmap is not type int (arg %d)",
57 + if (*format_chars == 'D')
59 + /* There should be an unsigned char * arg before the string arg. */
62 + status_warning (status, "too few arguments for format");
65 + if (info->first_arg_num != 0)
69 + cur_param = TREE_VALUE (params);
70 + params = TREE_CHAIN (params);
72 + cur_type = TREE_TYPE (cur_param);
73 + if (TREE_CODE (cur_type) != POINTER_TYPE
74 + || TYPE_MAIN_VARIANT (TREE_TYPE (cur_type))
75 + != unsigned_char_type_node)
77 + status_warning (status,
78 + "ethernet address is not type unsigned char * (arg %d)",
84 format_char = *format_chars;
86 || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK)
88 else if (strchr (fci->flags2, '2') != 0)
91 - status_warning (status, "`%%%c' yields only last 2 digits of year in some locales",
92 + status_warning (status, "`%%%c' yields only last 2 digits of year in some locals on non-BSD systems",
94 else if (y2k_level == 2)
95 status_warning (status, "`%%%c' yields only last 2 digits of year", format_char);