From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from movementarian.org ([178.79.150.28]:57858 "EHLO movementarian.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbfGQO5E (ORCPT ); Wed, 17 Jul 2019 10:57:04 -0400 Date: Wed, 17 Jul 2019 14:42:34 +0100 From: John Levon Subject: Packed struct size issue Message-ID: <20190717134234.GA5551@movementarian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: smatch-owner@vger.kernel.org List-ID: To: smatch@vger.kernel.org Cc: andy@omniosce.org Andy Fiddaman discovered: $ cat ./test.c #include #include struct t1 { uint8_t critical_warning; uint16_t temperature; uint8_t available_spare; } __packed; _Static_assert(sizeof(struct t1) == 4, "bad size for t1"); struct t2 { uint8_t critical_warning; uint16_t temperature; uint8_t available_spare; }; _Static_assert(sizeof(struct t2) == 6, "bad size for t2"); $ ./smatch ./test.c ./test.c:10:34: error: static assertion failed: "bad size for t1" Looks like we lost this commit: https://github.com/illumos/smatch/commit/0c60237e4096b7576f0aec21a7545026c7041611#diff-0cd054d23ed9e02274eaa540fc7e6536 ?? This works: https://github.com/citrus-it/illumos-omnios/commit/88e29e1705a616695ec6f905c3cab1f600e12659?diff=unified regards john