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

Re: Xen reliance on non-standard GCC features


  • To: Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 5 Jun 2023 09:35:16 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5v/XTrrWLoijRJu9jih6Zh60Os7YKwA6mkBmmWPzVGc=; b=E/5tP9lIoxJmEPX98K89JnsI8VGPZ8z0WAcVgplArXJBm8+LPJJp9EBvt2OJ8w+SmRArsEdr0qgczfr2Lk3PSoLrzVpk9N5Zv8FN00rXinAFDNe1fB7VLC5pZV5LGRePQtXdO2ZAygdbpbGLQ8jpumT4arBJVGJyc/4kEUy5mzD6+8UKU5Nm/S1bgd31EI1KPGOcZKquKpAeuo1Tg/VdqlAcMlu/uffy3dmVdt2SzXrYYwXo/UpHW2Q9LNBZ4nNaukOWEWSV1cuBlpTcG4m0oP25jdKbcNc+1fuXu8C7Hq1aZJac/oozF/DzDb46vm2/XJsGrgbr32cRMvTzRDXhyA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ocJMtQ2jz00kP0oGxbEe6hXDWLsOSkQ7d8NTQe5tespwxTeVh90lzNQpltFpElaveL27IB0w0wbNo8vtO/jAiY8Q/CTDKwBBKarpeDDeGUYfyQUx02AGcTIsKgzTCBDH0CBT6thf4y/97Ydjdh9Ws0VWAVZHDTetBywVh091NhHz20h8RIxe4hD6dS24h0sv35qzVqDliqUBC6mQLFPMn8Pp8FIW932wEA4pQ6YujxdKNcEJQTtVZ66En4qzgaThd/IsJfiUQuHRvWUILeHynK7aR0C/j8Ojbf6CALwfkxSbAzEatfi0/Uu2624jD/Cy+GgN4A1J5FsXX0OQYS8cpw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <stefano.stabellini@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 05 Jun 2023 07:35:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.06.2023 07:28, Roberto Bagnara wrote:
> Finally, Xen seems to rely on explicitly undefined behavior, namely
> C99 UB 58: "A structure or union is defined as containing no named
> members (6.7.2.1)." All instances but one occur via macro BUILD_BUG_ON_ZERO,
> the remaining instance concerns struct
> `cpu_policy::<anonymous union>::<anonymous struct>::<anonymous 
> union>::<anonymous struct>'.
> Reliance on undefined behavior might be hard to justify.

For starters just a comment here: I'm pretty sure this case was discussed
before, and that it was agreed that if need be we'd simply add _ as the
name there. Yet then - how did you notice this? Code inspection? I would
expect no analysis tool would spot it because it's used for gcc < 4.6
only. And I doubt you run analysis tools in combination with this old a
gcc?

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.