From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sw.kopfweb.de (sw.kopfweb.de [212.43.91.82]) by sourceware.org (Postfix) with ESMTPS id C9EC13857C65 for ; Thu, 7 Mar 2024 14:11:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C9EC13857C65 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kopfweb.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kopfweb.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C9EC13857C65 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.43.91.82 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709820666; cv=none; b=qdym6rrlh9ysKqquLbMNL5v7XMyhL5loCylG3GqVe/gunELqqvy/RmrHHhx30YkB1g0ddVWmDRUNfTmbyC+5PDgWhv9zzKoPPCehM2DZHrF/X6Avo1o6e6U3NW+7v3DsvXCc51xNlyzVPNhiSCMTZZjwoKN3PaMG8EyTQqXNokc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709820666; c=relaxed/simple; bh=wjlqRZ9MVti4lVkPMQQ9Kqg3sR/66tDXq2ahhJNLr+U=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=C+agTTGguJsw0xTzI5a5bLr5fGAVwBpqkdE6KSuj0LBiAhozBLdpp4Og433BCmNolDO0xae3/cIvXTmwJVgVZTxep+vHwxroULs24UAVBxPhk7CoiekbM2ZeaaeT03hTYyvIC6H6R3KMhQdSSpVvDdkqOUbrgGzYU0gAGxIPELQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from SW16.corp.kopfgmbh.de (192.168.0.16) by SW16.corp.kopfgmbh.de (192.168.0.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 7 Mar 2024 15:11:00 +0100 Received: from SW16.corp.kopfgmbh.de ([fe80::a4e2:5dca:a199:d7d]) by SW16.corp.kopfgmbh.de ([fe80::a4e2:5dca:a199:d7d%9]) with mapi id 15.02.1118.040; Thu, 7 Mar 2024 15:11:00 +0100 From: Homam Alkhateeb To: "gcc-help@gcc.gnu.org" Subject: Gnu compiler version 4.7.0, dialect -std=c99 with -fshort-enums vs. GHS with --short_enum Thread-Topic: Gnu compiler version 4.7.0, dialect -std=c99 with -fshort-enums vs. GHS with --short_enum Thread-Index: AdpwmUH8Vyrm7c0aSnCR0z2BvcLtcg== Date: Thu, 7 Mar 2024 14:11:00 +0000 Message-ID: <1470a2d3f72c4cfe83943606802b0b3e@kopfweb.de> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.4.59] Content-Type: multipart/alternative; boundary="_000_1470a2d3f72c4cfe83943606802b0b3ekopfwebde_" MIME-Version: 1.0 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_FAIL,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --_000_1470a2d3f72c4cfe83943606802b0b3ekopfwebde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello GCC-Support Team, we're using the gcc compiler version 4.7.0 and dialect -std=3Dc99 with Opti= on -fshort-enums to compile a C project on a Host Simulation using TESSY. according to the Using the GNU Compiler Collection Page 302: if there are negative values it is the = first of signed char, short and int that can represent all the values, othe= rwise it is the first of unsigned char, unsigned short and unsigned int tha= t can represent all the values. On the Real Target we use the GHS_PPC_Compiler_2022_1_4 C99 with the --shor= t_enum option. We want to make short enums identical for both Compiler. according to the PPC ABI, enum members are signed. The --short_enum option = instructs the compiler to use the smallest possible data type: First short, then unsigned short, then signed int, then unsigned int etc. e.g. typedef enum { MY_ENUM_A =3D 0, MY_ENUM_A =3D 256 } MY_ENUM; MY_ENUM Value; /* Value is here short using GHS_PPC_Compiler_2022_1_4 C99 = with the --short_enum but unsigned short using GNU with th= e -fshort_enums */ Mit freundlichen Gr=FC=DFen / Best regards Homam Alkhateeb KOPF GmbH / Kapbachstr. 6 / 76829 Landau / Germany Tel.: +49 6341 91767-36 / Email: homam.alkhateeb@kopfweb.de Gesch=E4ftsf=FChrer: Oliver Kopf - HRB L= andau Nr. 3090 - Amtsgericht Landau --_000_1470a2d3f72c4cfe83943606802b0b3ekopfwebde_--