Skip to content

Commit

Permalink
add gitignore, fix c99 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
digama0 committed Jan 4, 2022
1 parent 5d105ff commit 255e9b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.o
*.Po
autom4te.cache/
stamp-h1
missing
metamath
Makefile
Makefile.in
compile
configure
config.*
depcomp
install-sh
aclocal.m4
5 changes: 4 additions & 1 deletion metamath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,10 @@ void command(int argc, char *argv[]) {
}
}
/* Do the operating system command */
(void)system(str1);
/* The use of (void)!f() is to ignore the value on both
clang (which takes (void) as an ignore indicator)
and gcc (which doesn't but is fooled by the ! operator). */
(void)!system(str1);
#ifdef VAXC
printf("\n"); /* Last line from VAX doesn't have new line */
#endif
Expand Down
12 changes: 1 addition & 11 deletions mminou.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ flag print2(char* fmt, ...) {
long i;

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


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

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

0 comments on commit 255e9b5

Please sign in to comment.