mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Fixed compiler warnings
Fixed some compiler warnings. Added work around for a gcc warning bug.
This commit is contained in:
15
CHANGES
15
CHANGES
@@ -1,7 +1,18 @@
|
||||
The following are the changes from calc version 2.12.6.5 to date:
|
||||
The following are the changes from calc version 2.12.6.6 to date:
|
||||
|
||||
For historical purposes, in lucas.cal, gen_v1(1, n) always returns 4.
|
||||
|
||||
Fixed some compiler warnings, thanks to a report by Mike
|
||||
<michael dot d dot ince at gmail dot com>.
|
||||
|
||||
Added work around for a gcc warning bug, thanks to a report by Mike
|
||||
<michael dot d dot ince at gmail dot com>.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.12.6.4 to 2.12.6.5:
|
||||
|
||||
Fixed warning about undefined operations involving the qlink(q)
|
||||
macro by deplacing that macro with an inline-function. Thanks goes
|
||||
macro by replacing that macro with an inline-function. Thanks goes
|
||||
to David Haller <dnh at opensuse dot org> for this fix.
|
||||
|
||||
NOTE for Windows 10 users: Pavel Nemec <pane at seznam dot cz>
|
||||
|
10
calc.c
10
calc.c
@@ -104,6 +104,7 @@ main(int argc, char **argv)
|
||||
int c; /* option */
|
||||
int index;
|
||||
int maxindex;
|
||||
int unusedint = 0; /* avoids gcc compiler warning bug - '...assigned, but never used...' */
|
||||
char *cp;
|
||||
char *endcp;
|
||||
char *bp;
|
||||
@@ -278,7 +279,7 @@ main(int argc, char **argv)
|
||||
exit(6);
|
||||
}
|
||||
calc_debug = cp;
|
||||
(void) strtol(cp, &endcp, 10);
|
||||
unusedint = strtol(cp, &endcp, 10); /* avoids gcc compiler warning bug */
|
||||
cp = endcp;
|
||||
if (*cp != '\0' &&
|
||||
*cp != ' ' && *cp != ':') {
|
||||
@@ -310,7 +311,7 @@ main(int argc, char **argv)
|
||||
exit(9);
|
||||
}
|
||||
resource_debug = cp;
|
||||
(void) strtol(cp, &endcp, 10);
|
||||
unusedint = strtol(cp, &endcp, 10); /* avoids gcc compiler warning bug */
|
||||
cp = endcp;
|
||||
if (*cp != '\0' &&
|
||||
*cp != ' ' && *cp != ':') {
|
||||
@@ -340,7 +341,7 @@ main(int argc, char **argv)
|
||||
exit(12);
|
||||
}
|
||||
user_debug = cp;
|
||||
(void) strtol(cp, &endcp, 10);
|
||||
unusedint = strtol(cp, &endcp, 10); /* avoids gcc compiler warning bug */
|
||||
cp = endcp;
|
||||
if (*cp != '\0' && *cp != ' ') {
|
||||
fprintf(stderr, "Bad syntax in"
|
||||
@@ -721,8 +722,9 @@ main(int argc, char **argv)
|
||||
printf("main: run_state = %s\n", run_state_name(run_state));
|
||||
|
||||
/*
|
||||
* all done
|
||||
* All done! - Jessica Noll, Age 2
|
||||
*/
|
||||
unusedint++; /* avoids gcc compiler warning bug */
|
||||
libcalc_call_me_last();
|
||||
return (run_state == RUN_EXIT_WITH_ERROR ||
|
||||
run_state == RUN_ZERO) ? 1 : 0;
|
||||
|
Reference in New Issue
Block a user