Thread (4 messages) 4 messages, 3 authors, 2023-06-06

Re: [PATCH] statinfo.h: move DTYPE defines from dir.h

From: Elijah Newren <hidden>
Date: 2023-06-03 02:04:49

Possibly related (same subject, not in this thread)

On Fri, Jun 2, 2023 at 6:56 PM Junio C Hamano [off-list ref] wrote:
Why does name-hash.c end up with two definitions?  Aren't we
properly guarding against multiple inclusions with

    #ifndef __DIR_H__
    #define __DIR_H__
        ...
    struct dir_entry {
        ...
    };
    #endif

or is there something funny going on?
There are two _different_ things named "struct dir_entry" in the codebase:

dir.h:struct dir_entry {
dir.h-  unsigned int len;
dir.h-  char name[FLEX_ARRAY]; /* more */
dir.h-};
--
name-hash.c:struct dir_entry {
name-hash.c-    struct hashmap_entry ent;
name-hash.c-    struct dir_entry *parent;
name-hash.c-    int nr;
name-hash.c-    unsigned int namelen;
name-hash.c-    char name[FLEX_ARRAY];
name-hash.c-};

So, name-hash.c cannot include anything that includes dir.h.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help