Login
You're viewing the functional.cafe public feed.
  • Nov 16, 2026, 3:46 PM

    @pulkomandy @kirtai
    Wondered about this specifically, because GCC 13 will give a similar warning about code such as
    int foo (struct Qux *);
    struct Qux;
    int bar (struct Qux *p) { return foo (p); }
    (the "struct Qux" in foo () & bar () are considered to come from different lexical scopes).

    💬 1🔄 0⭐ 0

Replies

  • Nov 16, 2026, 4:24 PM

    @tkchia @kirtai the problem went away after adding a missing include directive, so I guess there was some forward declaration involved. What's annoying is that I expected the warning to show the places where the two types were defined, and it didn't

    💬 1🔄 0⭐ 0
  • Nov 16, 2026, 5:26 PM

    @pulkomandy @kirtai
    > What's annoying is that I expected the warning to show the places where the two types were defined, and it didn't <
    It probably should.
    I think I normally get warnings of the form "expected 'struct Qux *' but argument is of type 'struct Qux *'", if I use "struct Qux" in a function prototype, without at least declaring
    struct Qux;
    beforehand; though I'm not sure if this indeed the issue you had.

    💬 0🔄 0⭐ 0