Комментарии:
Sir, can you make an example of how to do a unity build of multiple files?
ОтветитьHi, awesome subject. In a more advanced way, the static function doesn't have the name (string) in the binary's symbol table. The compiled code is still there and can be called directly, let's say, in the main() by the function address (using function pointer), but not by the function name. Unfortunately, you need to discover the address of the static function somehow.
ОтветитьIf they limit the scope making it "private" to the translation unit why do we even need header files (for documentation purposes?)
When I don't include a header file I can still use non-static functions defined in the other file (even though I get an implicit declaration warning)
.
ОтветитьThey should have used private instead of static.
ОтветитьAnother nice video, thanks. The doubt the stood in my mind is that if we change the effect of the function in the interface, in the example report_value wouldn't you still risk to break the program because even though the function signature did not change the effect (could be the return value) did change. I thought that we could change the static print but without affecting the return value or effect for the interface function otherwise the change would have to be communicated to all users of the interface I assume.
Ответить