Commit graph

7984 commits

Author SHA1 Message Date
carl 53fa893738 ANSI C version
More portability fixes.
2019-03-24 17:11:56 +08:00
carl 7063301f8c Add additional defines for compilation. 2019-03-24 17:09:29 +08:00
carl 086a2ac9ab Add additional defines for compilation. 2019-03-24 17:09:12 +08:00
carl c5f5bace63 Add additional defines for compilation. 2019-03-24 17:08:45 +08:00
David Given ae76564657
Merge pull request #183 from kernigh/kernigh-include
Include headers to declare functions
2019-03-23 12:31:32 +01:00
George Koehler bec236c108 Include more headers to declare functions.
This causes clang to give fewer warnings of implicit declarations of
functions.

In mach/pdp/cv/cv.c, rename wr_int2() to cv_int2() because it
conflicts with wr_int2() in <object.h>.

In util/ack, rename F_OK to F_TRANSFORM because it conflicts with F_OK
for access() in <unistd.h>.
2019-03-22 15:59:35 -04:00
George Koehler 84f65f7ce3 Raise _XOPEN_SOURCE from 500 to 700
In OpenBSD, _XOPEN_SOURCE 500 forces _POSIX_C_SOURCE down to 199506,
which hides the declarations of openat() and fdopendir() and causes
compiler warnings.

Don't set _POSIX_C_SOURCE, because _XOPEN_SOURCE may set
_POSIX_C_SOURCE to a different value.
2019-03-22 14:35:07 -04:00
George Koehler cdbff0dd1c Include <fcntl.h> or <unistd.h>
This silences some clang warnings of implicit declarations of
functions.  The `register int` silences a warning of implicit int.
2019-03-22 14:19:02 -04:00
George Koehler dd328215d8 Use %zu to print size_t count
This silences a compiler warning.
2019-03-22 14:09:50 -04:00
George Koehler f8cbe04447 Include <unistd.h> for lseek()
This unbreaks my build in OpenBSD.  The old `long lseek()` conflicts
with `off_t lseek()` in OpenBSD headers, because long and off_t are
different types.  Commit b4df26e caused "system.h" to include some
headers where OpenBSD declares lseek().

Manuals for lseek() say to #include <unistd.h>.  Do so to be portable
to systems where other headers don't declare lseek().
2019-03-22 13:18:07 -04:00
David Given 3f61c0d507
Merge pull request #181 from ccodere/carl-ansi-part1
More ANSI C conversion
2019-03-20 15:53:22 +01:00
carl b3814af1ba * Bugfix of "rename" across volumes, now simply copies the file instead. 2019-03-17 23:19:16 +08:00
carl de57335296 Try to update frontend driver. 2019-03-17 22:46:32 +08:00
carl 8b525f59c3 + ANSI C conversion 2019-03-17 22:46:32 +08:00
carl 3ac4504a5a + ANSI C conversion 2019-03-17 22:46:32 +08:00
carl 5a18b85b3f + ANSI C conversion 2019-03-17 22:46:32 +08:00
carl 75909230c9 + ANSI C conversion 2019-03-17 22:46:32 +08:00
carl 0df5d2f50b + Make it build with troff 2019-03-17 22:46:31 +08:00
carl 9f29c76c74 + Have the DEBUG version compile 2019-03-17 22:46:31 +08:00
carl 6bfac1d24d + Add sys_tmpnam() and sys_basename() 2019-03-17 22:46:31 +08:00
carl da71e5a018 Addition of tmpnam system function. 2019-03-17 22:46:31 +08:00
carl 91adc2849b + Have the DEBUG version compile 2019-03-17 22:46:31 +08:00
carl 9e93eb642b Better type checking on function callback. 2019-03-17 22:46:31 +08:00
David Given 43ea6e2bec
Merge pull request #177 from davidgiven/dtrg-8080
i80: Better peephole optimiser rules
2019-03-11 17:00:12 +01:00
David Given c59eae1429 Don't buffer overflow when trying to process source bytes with the high bit
set.
2019-03-11 13:50:30 +00:00
David Given 88fd7b3cdc Add a 'kill' pseudoinstruction to the 8080 assembler, which marks when the code
generator is finished with a register; use this to create some more effective
peephole optimiser rules.
2019-03-08 23:06:34 +01:00
David Given e2625813c9
Merge pull request #174 from ccodere/carl-ansi-part1
Carl ansi part1
2019-03-07 20:51:08 +01:00
carl 8f6073d446 + Better type checking in function tables. 2019-03-02 01:44:16 +08:00
carl 3867cfdaca + M2 Compiler ISO C90 compatibility
* Fixing of potential crash issue with function tables in compiler.
+ SYSTEM.h is now renamed to SYSTEMM2.h to avoid conflicts on non case sensitive filesystems.
2019-03-02 01:44:16 +08:00
carl 5f9a199257 CPP ISO C90 compatibility and conversion. 2019-03-02 01:44:16 +08:00
carl f371f452b5 Basic compiler is now ISO C90 compliant. 2019-03-02 01:44:16 +08:00
David Given ca3e272233
Merge pull request #173 from ccodere/carl-ansi-part1
Carl ansi part1
2019-02-25 23:23:04 +01:00
carl 9fab867333 Fix issue again with wrong macro on error. 2019-02-26 00:46:10 +08:00
carl bd52b1f8f5 * Fix more tabs. 2019-02-26 00:44:52 +08:00
carl e233db6dc0 * Convert spaces -> tabs to keep consistency with existing code. 2019-02-24 01:15:23 +08:00
carl f74b29d303 * Remove some more compiler warnings. 2019-02-24 00:46:05 +08:00
carl 9622898131 Bugfix of fprint using correct output redirection (fix from last commit). 2019-02-24 00:45:35 +08:00
carl 41cb541e7e Pascal compiler better type checking and function declarations (Better ISO C compatibility) 2019-02-24 00:44:50 +08:00
David Given d41ba12679
Merge pull request #172 from ccodere/carl-ansi-part1
Carl ansi part1
2019-02-20 19:36:49 +01:00
carl 4b5de6c203 Remove unused variable. 2019-02-21 00:43:49 +08:00
carl f7ba3eec50 Remove CMake changes and generic sed scripts so they are move to a separate branch. 2019-02-21 00:43:04 +08:00
carl a80248f204 * Was trying to use the new system API which is not ready causing stack issues. 2019-02-20 00:44:32 +08:00
carl 9ca8f42930 + Add missing files. 2019-02-20 00:32:19 +08:00
carl 79eb91c880 + Add topgen 2019-02-19 00:54:24 +08:00
carl d825e962ed Better ANSI C compatibility and portability:
+ Addition of function prototypes and include files.
+ Change function definitions to ANSI C style.
+ Initial support for CMake
2019-02-19 00:54:24 +08:00
carl cc27fd471d Better ANSI C compatibility and portability:
+ Addition of function prototypes and include files.
+ Change function definitions to ANSI C style.
+ Initial support for CMake
.
2019-02-19 00:54:23 +08:00
carl 750a6bc684 Better ANSI C compatibility and portability:
+ Addition of function prototypes and include files.
+ Change function definitions to ANSI C style.
+ Initial support for CMake
+ Scripts to generate compiler header is now sed based.
2019-02-19 00:54:23 +08:00
carl e70690c510 + Addition of scripts to generate compiler include files. 2019-02-19 00:54:23 +08:00
carl 910643ccbb Better ANSI C compatibility and portability:
+ Addition of function prototypes and include files.
+ Change function definitions to ANSI C style.
+ Initial support for CMake
2019-02-19 00:54:23 +08:00
carl 10717cc791 Better ANSI C compatibility and portability:
+ Addition of function prototypes and include files.
+ Change function definitions to ANSI C style.
- Remove support for generating K&R code.
- Remove mkstemp and replace by tmpnam (more portable but less safe)
2019-02-19 00:54:23 +08:00