2017-04-16 1 views
0

Ich habe meine ASST0 (Hallo Welt!) Getan. Aber wenn ich versuche ASST1 (Synchronisation) BNehmen Ergebnisse zu tun, sieht aus wie -Warum führt `bmake` in OS161 ASST1 zu Fehlercode 1?

[email protected]:~/cs350-os161/os161-1.99/kern/compile/ASST1$ bmake 
    cs350-gcc -g -Wall -W -Wwrite-strings -Wmissing-prototypes -Werror -std=gnu99 -mno-abicalls -fno-pic -ffixed-23 -nostdinc -I../../include -I../../dev -I. -Iincludelinks -ffreestanding -D_KERNEL -DUW -c ../../startup/math.c 
    cc1: warnings being treated as errors 
    ../../startup/math.c:65: warning: no previous prototype for ‘adder’ 
    ../../startup/math.c: In function ‘maths’: 
    ../../startup/math.c:157: warning: passing argument 3 of ‘thread_fork’ makes pointer from integer without a cast 
    ../../startup/math.c:157: warning: passing argument 5 of ‘thread_fork’ makes integer from pointer without a cast 
    *** Error code 1 

    Stop. 
    bmake: stopped in /home/newubuntu/cs350-os161/os161-1.99/kern/compile/ASST1 
    [email protected]:~/cs350-os161/os161-1.99/kern/compile/ASST1$ 

Erwähnt werden, dass es nicht geändert habe jeden in math.c (Nicht-Synchronisation handhaben, einfach testen). Aber mein Freund hat den Code für die Synchronisation in seiner Maschine bearbeitet und das funktioniert (für 10 Threads). Interessanterweise, wenn er die Anzahl der Threads (NADDERS) 10 t0 20 ändert, wird bmake results error.

Antwort

0

Set-Prototyp der Funktion adder in math.c. , d.h. return_type adder(arguments);

Und überprüfen Sie thread_fork() Funktionsdefinition. Korrekte Parameterreihenfolge für .

Verwandte Themen