Skip to content

a bunch of errors when doing makefile.js #47

Description

@vihsc

when ever i do node makefile.js release the compiler will fail and now make some of the files. all of the output sfrom the error :
src/util.c: In function 'qmalloc_init':
src/util.c:30:23: error: allocation of insufficient size '1' for type 'void *' with size '8' [-Werror=alloc-size]
30 | qmalloc_slabs = malloc(1);
| ^
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/decoder.c -c -o build/objs/jj-decoder-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/eflags.c -c -o build/objs/jj-eflags-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/prot.c -c -o build/objs/jj-prot-s4y8.o -Iinclude
src/state.c: In function 'state_create_bjson_object':
src/state.c:252:31: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
252 | obj->keys = calloc(sizeof(struct bjson_key_value), keyvalues);
| ^~~~~~
src/state.c:252:31: note: earlier argument should specify number of elements, later size of each element
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/opcodes.c -c -o build/objs/jj-opcodes-s4y8.o -Iinclude
src/state.c: In function 'state_file':
src/state.c:396:18: error: implicit declaration of function 'open'; did you mean 'fopen'? [-Wimplicit-function-declaration]
396 | int fd = open(temp, O_RDONLY | O_BINARY);
| ^~~~
| fopen
src/pc.c: In function 'bios_writeb':
src/state.c:399:13: error: implicit declaration of function 'read'; did you mean 'read8'? [-Wimplicit-function-declaration]
399 | if (read(fd, ptr, size) != size)
| ^~~~
| read8
src/state.c:401:9: error: implicit declaration of function 'close'; did you mean 'fclose'? [-Wimplicit-function-declaration]
401 | close(fd);
| ^~~~~
| fclose
src/state.c:412:13: error: implicit declaration of function 'write'; did you mean 'write8'? [-Wimplicit-function-declaration]
412 | if (write(fd, ptr, size) != size)
| ^~~~~
| write8
src/state.c: In function 'state_read_from_file':
src/state.c:448:16: error: implicit declaration of function 'lseek'; did you mean 'fseek'? [-Wimplicit-function-declaration]
448 | int size = lseek(fd, 0, SEEK_END);
| ^~~~~
| fseek
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/arith.c -c -o build/objs/u8-arith-s4y8.o -Iinclude
src/state.c: In function 'state_mkdir':
src/state.c:539:9: error: implicit declaration of function 'mkdir' [-Wimplicit-function-declaration]
539 | if (mkdir(path) == -1) {
| ^~~~~
src/pc.c:143:50: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks nonstring' attribute (9 chars into 8 available) [-Werror=unterminated-string-initialization]
143 | static const unsigned char shutdown[8] = "Shutdown";
| ^~~~~~~~~~
cc1.exe: all warnings being treated as errors
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/io.c -c -o build/objs/u8-io-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/string.c -c -o build/objs/u8-string-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/stack.c -c -o build/objs/u8-stack-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/misc.c -c -o build/objs/u8-misc-s4y8.o -Iinclude
src/display.c:11:10: fatal error: SDL/SDL.h: No such file or directory
11 | #include <SDL/SDL.h>
| ^~~~~~~~~~~
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/bit.c -c -o build/objs/u8-bit-s4y8.o -Iinclude
compilation termgcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/softfloat.c -c -o build/objs/jj-softfloat-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/fpu.c -c -o build/objs/jj-fpu-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/cpu/ops/simd.c -c -o build/objs/u8-simd-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/dma.c -c -o build/objs/xx-dma-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/cmos.c -c -o build/objs/xx-cmos-s4y8.o -Iinclude
igcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/pit.c -c -o build/objs/xx-pit-s4y8.o -Iinclude
src/drive.c: In function 'drive_read_file':
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/pic.c -c -o build/objs/xx-pic-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/kbd.c -c -o build/objs/xx-kbd-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/vga.c -c -o build/objs/xx-vga-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/ide.c -c -o build/objs/xx-ide-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/pci.c -c -o build/objs/xx-pci-s4y8.o -Iinclude
cc1.exe: all warnings being treated as errors
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/apic.c -c -o build/objs/xx-apic-s4y8.o -Iinclude
nsrc/drive.c:154:10: error: implicit declaration of function 'open'; did you mean 'fopen'? [-Wimplicit-function-declaration]
154 | fd = open(temp, O_RDONLY | O_BINARY);
| ^~~~
| fopen
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/ioapic.c -c -o build/objs/xx-ioapic-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/fdc.c -c -o build/objs/xx-fdc-s4y8.o -Iinclude
gcc -Wall -Wextra -Werror -std=c99 -DNATIVE_BUILD -O3 src/hardware/acpi.c -c -o build/objs/xx-acpi-s4y8.o -Iinclude
Failed to compile: src/state.c
asrc/drive.c:163:16: error: implicit declaration of function 'lseek'; did you mean 'fseek'? [-Wimplicit-function-declaration]
163 | size = lseek(fd, 0, SEEK_END);
| ^~~~~
| fseek
tcc1.exe: all warnings being treated as errors
Failed to compile: src/util.c
esrc/drive.c:165:13: error: implicit declaration of function 'read'; did you mean 'fread'? [-Wimplicit-function-declaration]
165 | if (read(fd, data, size) != (ssize_t)size)
| ^~~~
| fread
dsrc/drive.c:167:9: error: implicit declaration of function 'close'; did you mean 'fclose'? [-Wimplicit-function-declaration]
167 | close(fd);
| ^~~~~
| fclose
Failed to compile: src/pc.c
.src/drive.c: In function 'drive_internal_init':

src/drive.c:665:33: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
665 | drv->blocks = calloc(sizeof(struct block_info), drv->block_count);
| ^~~~~~
src/drive.c:665:33: note: earlier argument should specify number of elements, later size of each element
In file included from include/softfloat/softfloatx80.h:30,
from src/cpu/fpu.c:48:
include/softfloat/softfloat-specialize.h: In function 'floatx80_is_nan':
src/drive.c: In function 'drive_simple_write':
In file included from src/cpu/softfloat.c:68:
include/softfloat/softfloat-specialize.h: In function 'floatx80_is_nan':
include/softfloat/softfloat-specialize.h:557:44: error: '<<' in boolean context, did you mean '<'? [-Werror=int-in-bool-context]
557 | return ((a.exp & 0x7FFF) == 0x7FFF) && (int64_t) (a.fraction<<1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Failed to compile: src/display.c
In file included from include/cpuapi.h:5,
from src/hardware/apic.c:10:
src/hardware/apic.c: In function 'apic_next':
src/drive.c:844:17: error: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration]
844 | if (write(info->fd, buffer, 512) != 512)
| ^~~~~
| fwrite
include/softfloat/softfloat-specialize.h:557:44: error: '<<' in boolean context, did you mean '<'? [-Werror=int-in-bool-context]
557 | return ((a.exp & 0x7FFF) == 0x7FFF) && (int64_t) (a.fraction<<1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/util.h:43:48: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'itick_t' {aka 'long long unsigned int'} [-Werror=format=]
43 | #define LOG(component, x, ...) fprintf(stderr, "[" component "] " x, ##VA_ARGS)
| ^~~
src/hardware/apic.c:15:26: note: in expansion of macro 'LOG'
15 | #define APIC_LOG(x, ...) LOG("APIC", x, ##VA_ARGS)
| ^~~
src/hardware/apic.c:562:13: note: in expansion of macro 'APIC_LOG'
562 | APIC_LOG(" timer period %ld cur=%ld next=%ld\n", apic_get_period(), now, apic.timer_next);
| ^~~~~~~~
src/drive.c: In function 'drive_simple_init':
include/util.h:43:48: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'itick_t' {aka 'long long unsigned int'} [-Werror=format=]
43 | #define LOG(component, x, ...) fprintf(stderr, "[" component "] " x, ##VA_ARGS)
| ^~~
src/hardware/apic.c:15:26: note: in expansion of macro 'LOG'
15 | #define APIC_LOG(x, ...) LOG("APIC", x, ##VA_ARGS)
| ^~~
src/hardware/apic.c:562:13: note: in expansion of macro 'APIC_LOG'
562 | APIC_LOG(" timer period %ld cur=%ld next=%ld\n", apic_get_period(), now, apic.timer_next);
| ^~~~~~~~
src/drive.c:898:39: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
898 | sync_info->blocks = calloc(sizeof(uint8_t*), sync_info->block_array_size);
| ^~~~~~~
include/util.h:43:48: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'itick_t' {aka 'long long unsigned int'} [-Werror=format=]
43 | #define LOG(component, x, ...) fprintf(stderr, "[" component "] " x, ##VA_ARGS)
| ^~~
src/hardware/apic.c:15:26: note: in expansion of macro 'LOG'
15 | #define APIC_LOG(x, ...) LOG("APIC", x, ##VA_ARGS)
| ^~~
src/hardware/apic.c:562:13: note: in expansion of macro 'APIC_LOG'
562 | APIC_LOG(" timer period %ld cur=%ld next=%ld\n", apic_get_period(), now, apic.timer_next);
| ^~~~~~~~
src/drive.c:898:39: note: earlier argument should specify number of elements, later size of each element
cc1.exe: all warnings being treated as errors
Failed to compile: src/drive.c
cc1.exe: all warnings being treated as errors
Failed to compile: src/hardware/apic.c
cc1.exe: all warnings being treated as errors
Failed to compile: src/cpu/fpu.c
cc1.exe: all warnings being treated as errors
Failed to compile: src/cpu/softfloat.c
33/41 compiled successfully!
src/state.c, src/util.c, src/pc.c, src/display.c, src/drive.c, src/hardware/apic.c, src/cpu/fpu.c, src/cpu/softfloat.c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions