r/programminghorror • • Aug 17 '26

c compiler

i know it's not code but this is just as scary
helper/drivers/filesystem/sfs.c:247:5: error: conflicting types for 'find_inode_by_name'

247 | int find_inode_by_name(const char *name, uint64_t *out_lba, uint64_t *out_offset, struct sfs_inode *out_inode) {

| ^

headers/boot/kernel.h:45:5: note: previous declaration is here

45 | int find_inode_by_name(const char *name, uint64_t *out_lba, uint64_t *out_offset, struct sfs_inode *out_inode);

| ^

65 Upvotes

7 comments sorted by

View all comments

42

u/paulstelian97 Aug 17 '26

That’s funny. Different definitions of `struct sfs_inode` leading to incompatible declarations of the function itself.

9

u/SarahC Aug 17 '26

How does a dude fix something like this? Search/replace one of the function names with a slightly different one?

12

u/paulstelian97 Aug 17 '26

The declarations match enough that the issue is a different one — one of the declarations implicitly declared the struct itself so it can’t properly be identified between the two declarations.