<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/193356>193356</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Compile warning from `c-index-test.c` under Ubuntu 26.04 LTS
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jthackray
      </td>
    </tr>
</table>

<pre>
    Whilst compiling clang on Ubuntu 26.04, I get this warning from c-index-test.c:
```
 /home/jontha01/llvm-project/clang/tools/c-index-test/c-index-test.c:298:23: warning: '_Generic' is a C11 extension [-Wc11-extensions]
    298 | const char *sep = strchr(arg_string, ',');
        | ^
  /usr/include/string.h:265:3: note: expanded from macro 'strchr'
    265 |   __glibc_const_generic (S, const char *, strchr (S, C))
        |   ^
 /usr/include/aarch64-linux-gnu/sys/cdefs.h:838:3: note: expanded from macro '__glibc_const_generic'
    838 |   _Generic (0 ? (PTR) : (void *) 1, \
        |   ^
```

It appears that Ubuntu 26.04 LTS updates glibc's string.h so strchr(), strrchr() and strstr() are routed through _Generic-based macros. When Clang compiles c-index-test.c with -std=gnu89 and -pedantic, that now triggers -Wc11-extensions warnings even though the source itself is not using C11 features.

I believe that c-index-test.c is compiled with -std=gnu89 on purpose to act as a guard rail.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVMtu4zgQ_Br60pAhkdbroIOjrAYD7GGxM4scDUpsi8zKpMCHk_z9gpIdT5wsMIYhS22hu6rYVdw5NWrEhuQPJH_c8OClsc2zl3z41_K3TW_EW_Mk1eQ8DOY0q0npEYaJ6xGMhn_6oH0AWmzTHaEtfIcRPXipHLxwq-O7R2tOMCRKC3xNPDq_HQjbk3RPivTyTfdAaCfNCQntno32kqcZod00nU_JbM0zDp7QbplKaOeNmVx8_qXp3eMyg9ZVvDLC9lc08ZbQ8vANNVo1EF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