[Bug c/55422] gcc does not diagnose change of linkage for a function.

cookevillain at yahoo dot com gcc-bugzilla@gcc.gnu.org
Sun Jan 28 01:26:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55422

cookevillain at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.4.3                       |5.4.0

--- Comment #6 from cookevillain at yahoo dot com ---
I still believe (although it has been almost six years since the original
report) that gcc's diagnostics are inconsistent in this case. Here is a
slightly different version of the input above:

static void ff(int a) {

  return;

}

int f(void) {

  {
    int ff = 0;

    {

      extern void ff(int);

    }

    return ff;
  }

  ff(0);
}

gcc is silent about this file in every mode (c89, c11, etc.) although the only
difference between this code and the other example above is that ff is declared
as a function. I understand that gcc does not have to produce a diagnostic for
every undefined behavior (such as ff having both external and internal linkage
as above) but since it already diagnoses it for ordinary variables, why not
functions?


More information about the Gcc-bugs mailing list