aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-11-30 00:01:21 +0000
committerThomas Schwinge <tschwinge@gnu.org>2006-11-30 00:01:21 +0000
commite982c14bc34a48529ca0db1c016a768cce01e115 (patch)
treebdf201b23b9ec594b4e05704e2119b2e664b10a8
parent53280ebcfd46a129f34d6853a093c3cb425a068a (diff)
downloadmig-e982c14bc34a48529ca0db1c016a768cce01e115.tar.gz
mig-e982c14bc34a48529ca0db1c016a768cce01e115.tar.bz2
mig-e982c14bc34a48529ca0db1c016a768cce01e115.zip
2006-11-29 Thomas Schwinge <tschwinge@gnu.org>
Fix compiler, flex and bison warnings. * error.c: Include <stdlib.h>. * lexxer.h (yylex): Add declaration. * migcom.c: Include <stdlib.h>. (main): Set USER, SHEADER and IHEADER to `NULL' by default. (myfclose): Add lost conversion specifications. * parser.h (yyerror): Add declaration. * routine.c (rtPrintArg, rtCheckRoutine): Add braces to avoid ambiguousness. * server.c (WriteSymTabEntries): Make NUM an `u_int'. * user.c (WriteUserIndividual): Add a `default' case in a switch statement and add lost conversion specifications. * lexxer.l: Set option `nounput'. * parser.y (%left): Change commas to spaces.
-rw-r--r--ChangeLog15
-rw-r--r--error.c1
-rw-r--r--lexxer.h2
-rw-r--r--lexxer.l2
-rw-r--r--migcom.c11
-rw-r--r--parser.h2
-rw-r--r--parser.y4
-rw-r--r--routine.c14
-rw-r--r--server.c2
-rw-r--r--user.c4
10 files changed, 50 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e593bc..569f032 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2006-11-29 Thomas Schwinge <tschwinge@gnu.org>
+ Fix compiler, flex and bison warnings.
+ * error.c: Include <stdlib.h>.
+ * lexxer.h (yylex): Add declaration.
+ * migcom.c: Include <stdlib.h>.
+ (main): Set USER, SHEADER and IHEADER to `NULL' by default.
+ (myfclose): Add lost conversion specifications.
+ * parser.h (yyerror): Add declaration.
+ * routine.c (rtPrintArg, rtCheckRoutine): Add braces to avoid
+ ambiguousness.
+ * server.c (WriteSymTabEntries): Make NUM an `u_int'.
+ * user.c (WriteUserIndividual): Add a `default' case in a switch
+ statement and add lost conversion specifications.
+ * lexxer.l: Set option `nounput'.
+ * parser.y (%left): Change commas to spaces.
+
* configure.ac (AM_INIT_AUTOMAKE): Add the `no-define' option.
* build-aux/config.guess: New file, thanks to `autoreconf'.
diff --git a/error.c b/error.c
index ae97143..235603b 100644
--- a/error.c
+++ b/error.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdarg.h>
+#include <stdlib.h>
#include "global.h"
#include "error.h"
diff --git a/lexxer.h b/lexxer.h
index 822df89..47f1c93 100644
--- a/lexxer.h
+++ b/lexxer.h
@@ -31,3 +31,5 @@ extern void LookFileName(void);
extern void LookString(void);
extern void LookQString(void);
extern void LookNormal(void);
+
+extern int yylex (void);
diff --git a/lexxer.l b/lexxer.l
index 65ccbc1..91d5f71 100644
--- a/lexxer.l
+++ b/lexxer.l
@@ -1,3 +1,5 @@
+%option nounput
+
%k 10000
%n 5000
%a 20000
diff --git a/migcom.c b/migcom.c
index 40c274e..5da52b8 100644
--- a/migcom.c
+++ b/migcom.c
@@ -71,6 +71,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include "error.h"
#include "lexxer.h"
@@ -226,13 +227,17 @@ main(int argc, char **argv)
uheader = myfopen(UserHeaderFileName, "w");
if (!UserFilePrefix)
user = myfopen(UserFileName, "w");
+ else
+ user = NULL;
server = myfopen(ServerFileName, "w");
if (ServerHeaderFileName)
sheader = myfopen(ServerHeaderFileName, "w");
+ else
+ sheader = NULL;
if (IsKernelServer)
- {
iheader = myfopen(InternalHeaderFileName, "w");
- }
+ else
+ iheader = NULL;
if (BeVerbose)
{
@@ -324,5 +329,5 @@ static void
myfclose(FILE *file, const char *name)
{
if (ferror(file) || fclose(file))
- fatal("fclose(): ", name, unix_error_string(errno));
+ fatal("fclose(%s): %s", name, unix_error_string(errno));
}
diff --git a/parser.h b/parser.h
index 5dd38ac..651b66e 100644
--- a/parser.h
+++ b/parser.h
@@ -85,3 +85,5 @@ typedef union
extern YYSTYPE yylval;
+
+extern void yyerror(const char *);
diff --git a/parser.y b/parser.y
index 5ff1aae..cc149da 100644
--- a/parser.y
+++ b/parser.y
@@ -98,8 +98,8 @@
%token <string> syFileName
%token <flag> syIPCFlag
-%left syPlus,syMinus
-%left syStar,syDiv
+%left syPlus syMinus
+%left syStar syDiv
%type <statement_kind> ImportIndicant
diff --git a/routine.c b/routine.c
index c34b91f..fcdfaf1 100644
--- a/routine.c
+++ b/routine.c
@@ -236,33 +236,41 @@ rtPrintArg(register const argument_t *arg)
break;
default:
if (akCheck(arg->argKind, akbRequest))
+ {
if (akCheck(arg->argKind, akbSend))
printf("In");
else
printf("(In)");
+ }
if (akCheck(arg->argKind, akbReply))
+ {
if (akCheck(arg->argKind, akbReturn))
printf("Out");
else
printf("(Out)");
+ }
printf("\t");
}
printf("\t%s: %s", arg->argName, it->itName);
if (arg->argDeallocate != it->itDeallocate)
+ {
if (arg->argDeallocate == d_YES)
printf(", Dealloc");
else if (arg->argDeallocate == d_MAYBE)
printf(", Dealloc[]");
else
printf(", NotDealloc");
+ }
if (arg->argLongForm != it->itLongForm)
+ {
if (arg->argLongForm)
printf(", IsLong");
else
printf(", IsNotLong");
+ }
if (arg->argServerCopy)
printf(", ServerCopy");
@@ -1265,21 +1273,27 @@ rtCheckRoutine(register routine_t *rt)
doesn't have its own args and the user specified global values. */
if (rt->rtUReplyPort == argNULL)
+ {
if (rt->rtOneWay)
rtAddDummyReplyPort(rt, itZeroReplyPortType, 1);
else
rtAddDummyReplyPort(rt, itRealReplyPortType, 1);
+ }
if (rt->rtSReplyPort == argNULL)
+ {
if (rt->rtOneWay)
rtAddDummyReplyPort(rt, itZeroReplyPortType, 0);
else
rtAddDummyReplyPort(rt, itRealReplyPortType, 0);
+ }
if (rt->rtMsgOption == argNULL)
+ {
if (MsgOption == strNULL)
rtAddMsgOption(rt, "MACH_MSG_OPTION_NONE");
else
rtAddMsgOption(rt, MsgOption);
+ }
if ((rt->rtWaitTime == argNULL) &&
(WaitTime != strNULL))
diff --git a/server.c b/server.c
index 2768d80..a49bb01 100644
--- a/server.c
+++ b/server.c
@@ -100,7 +100,7 @@ WriteSymTabEntries(FILE *file, const statement_t *stats)
for (stat = stats; stat != stNULL; stat = stat->stNext)
if (stat->stKind == skRoutine) {
- register num = stat->stRoutine->rtNumber;
+ register u_int num = stat->stRoutine->rtNumber;
const char *name = stat->stRoutine->rtName;
while (++current <= num)
diff --git a/user.c b/user.c
index 8d0a2ab..16d4c02 100644
--- a/user.c
+++ b/user.c
@@ -1315,13 +1315,15 @@ WriteUserIndividual(const statement_t *stats)
case skUImport:
WriteImport(file, s->stFileName);
break;
+ default:
+ break;
}
}
WriteRoutine(file, stat->stRoutine);
WriteEpilog(file);
if (ferror(file) || fclose(file))
- fatal("fclose(): ", filename,
+ fatal("fclose(%s): %s", filename,
unix_error_string(errno));
strfree(filename);
}