1 $DragonFly: src/gnu/usr.bin/cc3/cc_int/patches/Attic/c-format.c.patch,v 1.1 2004/03/05 21:38:44 joerg Exp $
2 --- c-format.c.orig Tue Feb 24 18:37:09 2004
3 +++ c-format.c Tue Feb 24 18:43:03 2004
5 { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" },
6 /* GNU conversion specifiers. */
7 { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
8 + /* BSD conversion specifiers. */
9 + /* DragonFly kernel extensions (src/sys/kern/subr_prf.c).
10 + The format %b is supported to decode error registers.
11 + Its usage is: printf("reg=%b\n", regval, "<base><arg>*");
12 + which produces: reg=3<BITTWO,BITONE>
13 + The format %D provides a hexdump given a pointer and separator string:
14 + ("%6D", ptr, ":") -> XX:XX:XX:XX:XX:XX
15 + ("%*D", len, ptr, " ") -> XX XX XX XX ...
17 + { "D", 1, STD_EXT, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
18 + { "b", 1, STD_EXT, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
19 + { "ry", 0, STD_EXT, { T89_I, BADLEN, BADLEN, T89_L, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "i" },
20 { NULL, 0, 0, NOLENGTHS, NULL, NULL }
23 @@ -1898,6 +1910,57 @@
27 + if (*format_chars == 'b')
29 + /* There should be an int arg to control the string arg. */
32 + status_warning (status, "too few arguments for format");
35 + if (info->first_arg_num != 0)
37 + cur_param = TREE_VALUE (params);
38 + params = TREE_CHAIN (params);
40 + if ((TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
41 + != integer_type_node)
43 + (TYPE_MAIN_VARIANT (TREE_TYPE (cur_param))
44 + != unsigned_type_node))
46 + status_warning (status, "bitmap is not type int (arg %d)",
51 + if (*format_chars == 'D')
53 + /* There should be an unsigned char * arg before the string arg. */
56 + status_warning (status, "too few arguments for format");
59 + if (info->first_arg_num != 0)
63 + cur_param = TREE_VALUE (params);
64 + params = TREE_CHAIN (params);
66 + cur_type = TREE_TYPE (cur_param);
67 + if (TREE_CODE (cur_type) != POINTER_TYPE
68 + || TYPE_MAIN_VARIANT (TREE_TYPE (cur_type))
69 + != unsigned_char_type_node)
71 + status_warning (status,
72 + "ethernet address is not type unsigned char * (arg %d)",
78 format_char = *format_chars;
80 || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK)
82 else if (strchr (fci->flags2, '2') != 0)
85 - status_warning (status, "`%%%c' yields only last 2 digits of year in some locales",
86 + status_warning (status, "`%%%c' yields only last 2 digits of year in some locales on non-BSD systems",
88 else if (y2k_level == 2)
89 status_warning (status, "`%%%c' yields only last 2 digits of year", format_char);