[NSWI004] Error running make after implementing printk()

Quoc Anh Nguyen nquocanh97 at gmail.com
Sat Oct 10 20:02:51 CEST 2020


Worked for me too! Moved declarations of helper functions into the print.c
file.

so 10. 10. 2020 v 19:53 odesĂ­latel Krisztian Bokor <
bokorkrisztian7 at gmail.com> napsal:

> It works!! Oh my God, thanks a ton!
>
> On Sat, Oct 10, 2020, 19:45 Jan Výkruta <vykrutak at gmail.com> wrote:
>
>> There is a cyclic dependency: print.h -> adt/list.h -> debug.h -> print.h.
>>
>> Don't bother adding helper functions into print.h instead mark them
>> static in print.c and the compiler will shut up about missing declarations.
>>
>> On Sat, Oct 10, 2020 at 4:08 PM Krisztian Bokor <
>> bokorkrisztian7 at gmail.com> wrote:
>>
>>> Same issue
>>>
>>> On Sat, Oct 10, 2020, 16:07 Quoc Anh Nguyen <nquocanh97 at gmail.com>
>>> wrote:
>>>
>>>> Hello,
>>>> I have a problem running "make" after modifying the print.c file in
>>>> assignment 01. I cloned the a01-LOGIN repository, ran the "configure.py"
>>>> script and successfully ran the "make" command. I proceeded to edit
>>>> "kernel/src/lib/print.c" and "kernel/include/lib/print.h" to implement my
>>>> printk() function.
>>>> Then I ran the configure.py script and tried to run "make", but it gave
>>>> me this error:
>>>>
>>>> include/lib/print.h:15:14: error: unknown type name 'list_t'
>>>>    15 | void print_L(list_t* list);
>>>>
>>>> So I added #include <adt/list.h> to the print.h file. Now "make" gives
>>>> me this error:
>>>>
>>>> include/adt/list.h: In function 'link_init':
>>>> include/adt/list.h:127:5: error: implicit declaration of function
>>>> 'assert' [-Werror=implicit-function-declaration]
>>>>   127 |     assert(link != NULL);
>>>>       |     ^~~~~~
>>>> include/adt/list.h:9:1: note: 'assert' is defined in header
>>>> '<assert.h>'; did you forget to '#include <assert.h>'?
>>>>
>>>> What am I doing wrong here? I don't suppose I should just include the
>>>> assert.h file?
>>>> --
>>>> Nguyen
>>>> _______________________________________________
>>>> NSWI004 mailing list
>>>> NSWI004 at d3s.mff.cuni.cz
>>>> https://d3s.mff.cuni.cz/mailman/listinfo/nswi004
>>>>
>>> _______________________________________________
>>> NSWI004 mailing list
>>> NSWI004 at d3s.mff.cuni.cz
>>> https://d3s.mff.cuni.cz/mailman/listinfo/nswi004
>>>
>> _______________________________________________
>> NSWI004 mailing list
>> NSWI004 at d3s.mff.cuni.cz
>> https://d3s.mff.cuni.cz/mailman/listinfo/nswi004
>>
> _______________________________________________
> NSWI004 mailing list
> NSWI004 at d3s.mff.cuni.cz
> https://d3s.mff.cuni.cz/mailman/listinfo/nswi004
>


-- 
Nguyen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://d3s.mff.cuni.cz/pipermail/nswi004/attachments/20201010/f2eecc4a/attachment.htm>


More information about the NSWI004 mailing list