Re: Ichbiah 2022 compiler mode

Liste des GroupesRevenir à cl ada 
Sujet : Re: Ichbiah 2022 compiler mode
De : bauhaus (at) *nospam* notmyhomepage.invalid (G.B.)
Groupes : comp.lang.ada
Date : 21. Dec 2024, 18:19:12
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vk6tag$4tm1$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 21.12.24 09:14, Randy Brukardt wrote:

Note that :
1. I have no statistics, but it seems to me that there is more variables
than constants in my code.
 But how many of them *have* to be variables vs. the number that just are
because it is easier? I know I have a number of the latter.
 
2. I say "Useless" from my coder point of view, I dont know if it simplify
the work for compiler or tools implementers.
 Constants do help the compiler generate better code, although a lot of the
benefits can be gained also by working harder. (That's what C compilers do,
after all.)
What are some compilers offering today? That is, can they find declarations
of variables that could be constants, if so instructed?
I am seeing some warnings about non-initialized variables for a meaningless
mock-up, but not much else.  Ada, C++, Java.
(Maybe there are options that I have missed. Or an analysis of a whole
program yields more.)
function testc (b : Boolean) return Integer is
    package P is
      x : Integer;
    end;
begin
   if b then
      P.x := 42;
   end if;
   return P.x;
end testc;
int testc(bool b) {
    struct {
      int x;
    } P;
    if (b) {
      P.x = 42;
    }
    return P.x;
}
class testc {
   class P {
     int x;
   }
   P P;
   int $(boolean b) {
     if (b) {
        P.x = 42;
     }
     return P.x;
   }
}

Date Sujet#  Auteur
5 Sep 24 * Ichbiah 2022 compiler mode44Kevin Chadwick
5 Sep 24 +* Re: Ichbiah 2022 compiler mode6Jeffrey R.Carter
5 Sep 24 i+* Re: Ichbiah 2022 compiler mode2Bill Findlay
5 Sep 24 ii`- Re: Ichbiah 2022 compiler mode1Jeffrey R.Carter
5 Sep 24 i+- Re: Ichbiah 2022 compiler mode1Kevin Chadwick
5 Sep 24 i`* Re: Ichbiah 2022 compiler mode2Kevin Chadwick
5 Sep 24 i `- Re: Ichbiah 2022 compiler mode1Jeffrey R.Carter
6 Sep 24 +* Re: Ichbiah 2022 compiler mode35Randy Brukardt
6 Sep 24 i+* Re: Ichbiah 2022 compiler mode5Lawrence D'Oliveiro
12 Sep 24 ii`* Re: Ichbiah 2022 compiler mode4Randy Brukardt
12 Sep 24 ii `* Re: Ichbiah 2022 compiler mode3Lawrence D'Oliveiro
14 Sep 24 ii  `* Re: Ichbiah 2022 compiler mode2Randy Brukardt
14 Sep 24 ii   `- Re: Ichbiah 2022 compiler mode1Lawrence D'Oliveiro
6 Sep 24 i+* Re: Ichbiah 2022 compiler mode15Simon Wright
7 Sep 24 ii`* Re: Ichbiah 2022 compiler mode14Niklas Holsti
7 Sep 24 ii +- Re: Ichbiah 2022 compiler mode1Nioclás Pól Caileán de Ghloucester
12 Sep 24 ii `* Re: Ichbiah 2022 compiler mode12Randy Brukardt
12 Sep 24 ii  +* Re: Ichbiah 2022 compiler mode5Niklas Holsti
12 Sep 24 ii  i+- Re: Ichbiah 2022 compiler mode1Dmitry A. Kazakov
12 Sep 24 ii  i`* Re: Ichbiah 2022 compiler mode3Kevin Chadwick
12 Sep 24 ii  i +- Re: Ichbiah 2022 compiler mode1Niklas Holsti
13 Sep 24 ii  i `- Re: Ichbiah 2022 compiler mode1Nioclás Pól Caileán de Ghloucester
12 Sep 24 ii  `* Re: Ichbiah 2022 compiler mode6J-P. Rosen
12 Sep 24 ii   `* Re: Ichbiah 2022 compiler mode5Niklas Holsti
14 Sep 24 ii    `* Re: Ichbiah 2022 compiler mode4Randy Brukardt
14 Sep 24 ii     +- Re: Ichbiah 2022 compiler mode1Dmitry A. Kazakov
14 Sep 24 ii     +- Re: Ichbiah 2022 compiler mode1Lawrence D'Oliveiro
14 Sep 24 ii     `- Re: Ichbiah 2022 compiler mode1Niklas Holsti
21 Dec 24 i+* Re: Ichbiah 2022 compiler mode12Lioneldraghi
21 Dec 24 ii`* Re: Ichbiah 2022 compiler mode11Randy Brukardt
21 Dec 24 ii +* Re: Ichbiah 2022 compiler mode2Jeffrey R.Carter
24 Dec 24 ii i`- Re: Ichbiah 2022 compiler mode1Randy Brukardt
21 Dec 24 ii +* Re: Ichbiah 2022 compiler mode6G.B.
21 Dec 24 ii i+- Re: Ichbiah 2022 compiler mode1Chris Townley
22 Dec 24 ii i+* Re: Ichbiah 2022 compiler mode3Simon Wright
22 Dec 24 ii ii`* Re: Ichbiah 2022 compiler mode2G.B.
23 Dec 24 ii ii `- Re: Ichbiah 2022 compiler mode1Simon Wright
24 Dec 24 ii i`- Re: Ichbiah 2022 compiler mode1Randy Brukardt
21 Dec 24 ii `* Re: Ichbiah 2022 compiler mode2Keith Thompson
22 Dec 24 ii  `- Re: Ichbiah 2022 compiler mode1Pascal Obry
21 Dec 24 i`* Re: Ichbiah 2022 compiler mode2Lioneldraghi
21 Dec 24 i `- Re: Ichbiah 2022 compiler mode1Randy Brukardt
6 Sep 24 `* Re: Ichbiah 2022 compiler mode2Jeffrey R.Carter
6 Sep 24  `- Re: Ichbiah 2022 compiler mode1Nioclás Pól Caileán de Ghloucester

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal