Compiler is able to find function without matching .h file is updated?

Posted by Maxim Veksler on Stack Overflow See other posts from Stack Overflow or by Maxim Veksler
Published on 2010-03-13T14:27:38Z Indexed on 2010/03/13 14:35 UTC
Read the original article Hit count: 377

Hello Friends,

I'm writing a C University project and stumbled upon a compiler behavior which I don't understand.

In this file http://code.google.com/p/openu-bsc-maximveksler/source/browse/trunk/20465/semester/tasks/maman14/alpha/maman14/assembler/phaseOne.c?r=112 I've added a call to function named freeAsmInstruction(). This function is defined in file named lineParser.c, yet I haven't updated the matching lineParser.h header file to include this function declaration.

Why does this code compile? I would expect that gcc would fail to compile phaseOne.c until the correct lineParser.h is updated with the declaration of freeAsmInstruction().

I would appreciate an explanation.

Thank you, Maxim

© Stack Overflow or respective owner

Related posts about c

    Related posts about student-question