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

            Bug ID: 121581
           Summary: Code sample in __builtin_object_size documentation
                    does not compile
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tbaeder at redhat dot com
  Target Milestone: ---

The code sample from
https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html#index-_005f_005fbuiltin_005fobject_005fsize
does not compile due to a type mismatch: https://godbolt.org/z/WsYazax7c

<source>: In function 'f':
<source>:5:34: error: initialization of 'char *' from incompatible pointer type
'int *' [-Wincompatible-pointer-types]
    5 |     char *p = &var.buf1[1], *q = &var.b;
      |                                  ^
Compiler returned: 1

Reply via email to