WARNS=2 fixup.
Use __FBSDID(). Set NO_WERROR because this would rely on some lex(1) fixes that cannot be committed yet.
This commit is contained in:
parent
84c0ff2233
commit
3945c68f93
@ -1,11 +1,12 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG = colldef
|
||||
LFLAGS = -8 -i
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -I. -I${.CURDIR}/../../lib/libc/locale -DCOLLATE_DEBUG
|
||||
SRCS = parse.y scan.l y.tab.h
|
||||
LDADD = -ll
|
||||
DPADD = ${LIBL}
|
||||
PROG= colldef
|
||||
SRCS= parse.y scan.l y.tab.h
|
||||
WARNS?= 2
|
||||
NO_WERROR=yes
|
||||
LFLAGS= -8 -i
|
||||
CFLAGS+=-I. -I${.CURDIR}/../../lib/libc/locale -DCOLLATE_DEBUG -DYY_NO_UNPUT
|
||||
LDADD= -ll
|
||||
DPADD= ${LIBL}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -24,10 +24,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <err.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@ -39,10 +41,11 @@
|
||||
#include "common.h"
|
||||
|
||||
extern FILE *yyin;
|
||||
void yyerror(char *fmt, ...) __printflike(1, 2);
|
||||
void yyerror(const char *fmt, ...) __printflike(1, 2);
|
||||
int yyparse(void);
|
||||
int yylex(void);
|
||||
static void usage __P((void));
|
||||
static void usage(void);
|
||||
static void collate_print_tables(void);
|
||||
|
||||
char map_name[FILENAME_MAX] = ".";
|
||||
|
||||
@ -57,7 +60,7 @@ int prim_pri = 1, sec_pri = 1;
|
||||
int debug;
|
||||
#endif
|
||||
|
||||
char *out_file = "LC_COLLATE";
|
||||
const char *out_file = "LC_COLLATE";
|
||||
%}
|
||||
%union {
|
||||
u_char ch;
|
||||
@ -231,6 +234,7 @@ sec_sub_item : CHAR {
|
||||
%%
|
||||
int
|
||||
main(ac, av)
|
||||
int ac;
|
||||
char **av;
|
||||
{
|
||||
int ch;
|
||||
@ -278,7 +282,8 @@ usage()
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
||||
void yyerror(char *fmt, ...)
|
||||
void
|
||||
yyerror(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char msg[128];
|
||||
@ -290,8 +295,8 @@ void yyerror(char *fmt, ...)
|
||||
}
|
||||
|
||||
#ifdef COLLATE_DEBUG
|
||||
void
|
||||
collate_print_tables()
|
||||
static void
|
||||
collate_print_tables(void)
|
||||
{
|
||||
int i;
|
||||
struct __collate_st_chain_pri *p2;
|
||||
|
@ -25,10 +25,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <unistd.h>
|
||||
@ -45,6 +47,7 @@ YY_BUFFER_STATE main_buf, map_buf;
|
||||
#ifdef FLEX_DEBUG
|
||||
YYSTYPE yylval;
|
||||
#endif /* FLEX_DEBUG */
|
||||
int yylex(void);
|
||||
%}
|
||||
%%
|
||||
<INITIAL,charmap,nchar,subs,subs2>[ \t]+ ;
|
||||
@ -166,7 +169,7 @@ YYSTYPE yylval;
|
||||
return STRING;
|
||||
}
|
||||
<name,defn>. {
|
||||
char *s = (map_fp != NULL) ? map_name : "input";
|
||||
const char *s = (map_fp != NULL) ? map_name : "input";
|
||||
|
||||
if (!isascii(*yytext) || !isprint(*yytext))
|
||||
errx(EX_UNAVAILABLE, "non-ASCII or non-printable character 0x%02x not allowed in the map/name near line %u of %s",
|
||||
@ -219,12 +222,12 @@ YYSTYPE yylval;
|
||||
*ptr++ = '\a';
|
||||
}
|
||||
<name,string,defn>\n {
|
||||
char *s = (map_fp != NULL) ? map_name : "input";
|
||||
const char *s = (map_fp != NULL) ? map_name : "input";
|
||||
|
||||
errx(EX_UNAVAILABLE, "unterminated map/name/string near line %u of %s", line_no, s);
|
||||
}
|
||||
<name,string,nchar><<EOF>> {
|
||||
char *s = (map_fp != NULL) ? map_name : "input";
|
||||
const char *s = (map_fp != NULL) ? map_name : "input";
|
||||
|
||||
errx(EX_UNAVAILABLE, "premature EOF in the name/string/char near line %u of %s", line_no, s);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user