[Bug c/83236] New: "Did you mean" suggestions maybe shouldn't offer implementation-private names

zackw at panix dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 30 23:30:00 GMT 2017


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

            Bug ID: 83236
           Summary: "Did you mean" suggestions maybe shouldn't offer
                    implementation-private names
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zackw at panix dot com
  Target Milestone: ---

On Linux/glibc,

$ cat > test.c <<EOF
#include <sys/stat.h>
ino_t inode;
EOF
$ gcc -std=c89 -fsyntax-only test.c
test.c:2:1: error: unknown type name ‘ino_t’; did you mean ‘__ino_t’?
 ino_t inode;
 ^~~~~
 __ino_t
$ gcc --version
gcc (Debian 7.2.0-16) 7.2.0

__ino_t is an implementation detail of glibc's headers, and application
programmers shouldn't be encouraged to use it.

To first order, I don't think any implementation-namespace names (/^_[_A-Z]/)
should be offered as suggestions.  To second order, they could be suggested
when the unknown symbol is itself in the implementation namespace, or when the
suggestion is a _documented_ impl-namespace symbol like __DATE__ or _IOFBF or
_Bool.


More information about the Gcc-bugs mailing list