Skip to content

Commit 73b6b8d

Browse files
authored
add gitignore, fix c99 warnings (#15)
1 parent 87c4352 commit 73b6b8d

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.o
2+
*.Po
3+
autom4te.cache/
4+
stamp-h1
5+
missing
6+
metamath
7+
Makefile
8+
Makefile.in
9+
compile
10+
configure
11+
config.*
12+
depcomp
13+
install-sh
14+
aclocal.m4

metamath.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,10 @@ void command(int argc, char *argv[]) {
10611061
}
10621062
}
10631063
/* Do the operating system command */
1064-
(void)system(str1);
1064+
/* The use of (void)!f() is to ignore the value on both
1065+
clang (which takes (void) as an ignore indicator)
1066+
and gcc (which doesn't but is fooled by the ! operator). */
1067+
(void)!system(str1);
10651068
#ifdef VAXC
10661069
printf("\n"); /* Last line from VAX doesn't have new line */
10671070
#endif

mminou.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ flag print2(char* fmt, ...) {
8181
long i;
8282

8383
char *printBuffer; /* Allocated dynamically */
84-
/* gcc (Debian 4.9.2-10+deb8u2) 4.9.2 gives error for ssize_t if -c99
85-
is specified; gcc (GCC) 7.3.0 doesn't complain if -c99 is specified */
86-
/* See https://sourceforge.net/p/predef/wiki/Compilers/ for __LCC__ */
87-
#ifdef __LCC__ /* ssize_t not defined for lcc compiler */
88-
long bufsiz;
89-
#else
90-
ssize_t bufsiz; /* ssize_t (signed size_t) can represent the number -1 for
91-
error checking */
92-
#endif
93-
9484

9585
if (backBufferPos == 0) {
9686
/* Initialize backBuffer - 1st time in program */
@@ -216,7 +206,7 @@ flag print2(char* fmt, ...) {
216206

217207
/* Allow unlimited output size */
218208
va_start(ap, fmt);
219-
bufsiz = vsnprintf(NULL, 0, fmt, ap); /* Get the buffer size we need */
209+
int bufsiz = vsnprintf(NULL, 0, fmt, ap); /* Get the buffer size we need */
220210
va_end(ap);
221211
/* Warning: some older complilers, including lcc-win32 version 3.8 (2004),
222212
return -1 instead of the buffer size */

0 commit comments

Comments
 (0)