-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Hello!
Obviously, in it's current state, this fails quite badly:
Ingwie@Ingwies-Macbook-Pro.local ~/W/G/d/out $ gcc ../kernel/*.c -o dao
../kernel/daoPlatform.c:101:2: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
gettimeofday( & tv, NULL);
^
1 warning generated.
../kernel/daoVmspace.c:2848:8: warning: implicit declaration of function 'getcwd' is invalid in C99 [-Wimplicit-function-declaration]
cwd = getcwd( masterVmSpace->startPath->chars, 511 );
^
../kernel/daoVmspace.c:2848:6: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
cwd = getcwd( masterVmSpace->startPath->chars, 511 );
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
Ingwie@Ingwies-Macbook-Pro.local ~/W/G/d/out $ ./dao
fish: './dao' terminated by signal SIGSEGV (Address boundary error)
When using the (dao)makefiles, I see that only a few definitions are actually added, such as -DMACOSX or -DBSD and -DUNIX. This can, in fact, easily be deduced off a few #ifdef checks:
#ifdef __APPLE__
#define MACOSX
#define BSD
#define UNIX
#endifThere is a super comprehensive "feature detection" header here: https://github.com/msadeqhe/platform-id/blob/master/include/platform-id.h
You may be able to pick this up and modify it to automatically define DAO_-macros. This would make blind-compiles like my showcase above possible, simplify the bootstrap process a little and also allow for people with neither make nor any other means of building, to compile this language right away.
Kind regards,
Ingwie.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels