From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58632 invoked by alias); 6 Apr 2017 19:20:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 58572 invoked by uid 89); 6 Apr 2017 19:20:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-oln040092068066.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.92.68.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Apr 2017 19:20:32 +0000 Received: from AM5EUR02FT065.eop-EUR02.prod.protection.outlook.com (10.152.8.54) by AM5EUR02HT241.eop-EUR02.prod.protection.outlook.com (10.152.9.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5; Thu, 6 Apr 2017 19:20:30 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com (10.152.8.59) by AM5EUR02FT065.mail.protection.outlook.com (10.152.9.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.5 via Frontend Transport; Thu, 6 Apr 2017 19:20:30 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com ([fe80::a806:64f0:6377:f3ea]) by AM4PR0701MB2162.eurprd07.prod.outlook.com ([fe80::a806:64f0:6377:f3ea%19]) with mapi id 15.01.1019.015; Thu, 6 Apr 2017 19:20:30 +0000 From: Bernd Edlinger To: Florian Weimer , Richard Biener , Jakub Jelinek CC: Jonathan Wakely , GCC Patches , Jason Merrill , Jeff Law Subject: Re: [PATCH] Add a new type attribute always_alias (PR79671) Date: Thu, 06 Apr 2017 19:20:00 -0000 Message-ID: References: <20170405160849.GV17461@tucnak> <20170406075104.GA17461@tucnak> <7d17b3b7-2d38-6184-8bd6-eb9f96f87912@redhat.com> <50936a77-870a-5156-1f5e-b1e0327498b6@redhat.com> <1a0cdc64-3c65-4f2b-427d-8dcb90095cab@redhat.com> <5dee05a9-7606-ee9f-2d3e-d216a5837097@redhat.com> In-Reply-To: <5dee05a9-7606-ee9f-2d3e-d216a5837097@redhat.com> authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=hotmail.de; x-incomingtopheadermarker: OriginalChecksum:EBF9916395FA0DDE8BF396BA24F987F48B0A08B6698CA4FB779C4A863DF85FF9;UpperCasedChecksum:B00F49E491F58DF15B8EB7B32B2B4D947A63D33192047829B22334821E9EA77C;SizeAsReceived:9191;Count:40 x-ms-exchange-messagesentrepresentingtype: 1 x-microsoft-exchange-diagnostics: 1;AM5EUR02HT241;5:foAkMMwKqcpiyoEYK6NSGTT4oFNBzOafp5sJL4YoniL84X0iqDVn2jRLAAZ7Xoz2d9TELtkg80L7O5SKwOKpzZlr6jVcZwsajjWYfIG80Dlq0bD002eW1bPsLi85TqU6gp3M0mF1+J0SpNffy7+lcw==;24:l7IAhGFbmJS38r0vBuRbY8oOxoVUkRq5ivO63W66q34DkkyHVd7qSZIQ9hNOL9QLbvinCB9JYzqkPZvmCEoGzm3oHLKZ7ex6dp/k79f1oVs=;7:6oiUNGJZs8+JIkZNN2TaZWqxljospV+inw1xnlLyaR5V8AYDkQ/Ee+bEQjwkB7UAqr5+fMqcE9jvSFVQF/K5I+9tcsT5fdynwGJHk4itjaOYae1b1YlcLpGWomxFlGaj9BLPVA9wzIAG9mg/C5HSASpU7nfJ12+ZTz2wOHtpB07LxlAdtVF/C4rjUMakUV1i9Rvii7wBHhcJ6Zp9F75akfNUQIjtcAOwJo4NBYW3qwKI/FD8gHphj+7W7S7aVhEMQBxiqqa5H4Pk0314lRx43xgYkV6onefw5mXrWUnaK1JiD2iIbX20cxsA3y/dWeib x-incomingheadercount: 40 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:AM5EUR02HT241;H:AM4PR0701MB2162.eurprd07.prod.outlook.com;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: 51e62ba9-69cd-41bb-174b-08d47d21fc8a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322274)(1603101448)(1601125374)(1701031045);SRVR:AM5EUR02HT241; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(444000031);SRVR:AM5EUR02HT241;BCL:0;PCL:0;RULEID:;SRVR:AM5EUR02HT241; x-forefront-prvs: 02698DF457 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2017 19:20:29.9671 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT241 X-SW-Source: 2017-04/txt/msg00330.txt.bz2 On 04/06/17 21:05, Florian Weimer wrote: > On 04/06/2017 08:49 PM, Bernd Edlinger wrote: > >> For instance how do you "declare an object without a declared type"? > > malloc and other allocation functions return pointers to objects without > a declared type. > Thanks Florian, this discussion is very helpful. How about this for the documentation: @item typeless_storage @cindex @code{typeless_storage} type attribute In the context of section 6.5 paragraph 6 of the C11 standard, an object of this type behaves as if it has no declared type. In the context of section 6.5 paragraph 7 of the C11 standard, an object or a pointer if this type behaves as if it were a character type. This is attribute is similar to the @code{may_alias} attribute, except that it is not restricted to pointers. Example of use: @smallexample typedef int __attribute__((__typeless_storage__)) int_a; int main (void) @{ int_a a =3D 0x12345678; short *b =3D (short *) &a; b[1] =3D 0; if (a =3D=3D 0x12345678) abort(); exit(0); @} @end smallexample Bernd.