Skip to content
  • Olivier Fourdan's avatar
    render: Fix build with gcc 12 · c6b0dcb8
    Olivier Fourdan authored
    The xserver fails to compile with the latest gcc 12:
    
     render/picture.c: In function ‘CreateSolidPicture’:
     render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds]
      874 |     pPicture->pSourcePict->type = SourcePictTypeSolidFill;
          |                          ^~
     render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’
      868 |     pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     render/picture.c: In function ‘CreateLinearGradientPicture’:
     render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds]
      906 |     pPicture->pSourcePict->linear.type = SourcePictTypeLinear;
          |                          ^~
     render/picture.c:899:45: note: object of size 3...
    c6b0dcb8