tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] will touch memory past end of the struct


From: Larry Doolittle
Subject: [Tinycc-devel] will touch memory past end of the struct
Date: Sun, 14 May 2017 02:01:53 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

tinycc maintainers -

I know there's been a lot of work on bitfields lately.

Here's a stand-alone code snippet extracted from libgtk2.0-dev that triggers
one of the new warnings:
/usr/include/gtk-2.0/gtk/gtktable.h:99: warning: will touch memory past end of 
the struct (internal limitation)

typedef unsigned int guint;
typedef unsigned short int guint16;
struct _GtkTableRowCol
{
  guint16 requisition;
  guint16 allocation;
  guint16 spacing;
  guint need_expand : 1;
  guint need_shrink : 1;
  guint expand : 1;
  guint shrink : 1;
  guint empty : 1;
};

I just wanted to make sure that this is the intended effect.
It seems to me that the structure would get at least 64 bits reserved
in memory, and the bitfields will naturally be manipulated without
referring to any memory beyond that.

  - Larry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]