Commit a1e32bcf authored by Carl Worth's avatar Carl Worth

Add some compiler warnings and corresponding fixes.

Most of the current problems were (mostly) harmless things like
missing declarations, but there was at least one real error, (reversed
argument order for yyerrror).
parent 38aa8356
override CFLAGS += -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wno-unused
glcpp: glcpp.o glcpp-lex.o glcpp-parse.o
%.c %.h: %.y
......
......@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include "glcpp.h"
#include "glcpp-parse.h"
%}
......
......@@ -25,10 +25,12 @@
#include <stdio.h>
#include <stdlib.h>
#include "glcpp.h"
#define YYSTYPE int
void
yyerror (const char *error, void *scanner);
yyerror (void *scanner, const char *error);
%}
......@@ -54,7 +56,7 @@ token: TOKEN
%%
void
yyerror (const char *error, void *scanner)
yyerror (void *scanner, const char *error)
{
fprintf (stderr, "Parse error: %s\n", error);
}
......@@ -21,6 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
#include "glcpp.h"
int
main (void)
{
......
/*
* Copyright © 2010 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef GLCPP_H
#define GLCPP_H
/* Generated by glcpp-lex.l to glcpp-lex.c */
#define yyscan_t void*
int
yylex_init (yyscan_t *scanner);
int
yylex (yyscan_t scanner);
int
yylex_destroy (yyscan_t scanner);
/* Generated by glcpp-parse.y to glcpp-parse.c */
int
yyparse (void *scanner);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment