Re: Memory protection between compilation units?

Liste des GroupesRevenir à cl c  
Sujet : Re: Memory protection between compilation units?
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.lang.c
Date : 16. Jun 2025, 11:00:34
Autres entêtes
Organisation : To protect and to server
Message-ID : <102oq00$39jtn$1@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
On 2025-06-15, Waldek Hebisch <antispam@fricas.org> wrote:
Mateusz Viste <mateusz@not.gonna.tell> wrote:
 
That said, detecting out-of-bounds array access is no panacea. Memory
corruption can arise from various sources, such as dangling pointers or
poorly managed pointer arithmetic.
>
AFAICS there is no reason for explicit pointer arithmetic in well
written C programs.
 
LOL, you heard it here.
 
Implicit pointer arithmetic (coming from array
indexing) is done by compiler so should be no problem.  Like in
 
Array indexing *is* pointer arithmetic.
 
Are you not aware of this equivalence?
 
   (E1)[(E2)]   <--->  *((E1) + (E2))
 

Learn to read.

In fact, let's draw the commutative diagram
 
   (E1)[(E2)]   <--->  *((E1) + (E2))
      ^                     ^
      |                     |
      |                     |
      v                     v
   (E2)[(E1)]   <--->  *((E2) + (E1))
 
You're not saying anything here other than that you like the p[i]
/notation/ better than *(p + i), and &p[i] better than p + i.

The indexing notation at least have chance of being automatically
checked (in cases when compiler/checker knows array size).  With arbitrary
user-written pointer arithmetic there is no hope of automatic checking.

--
                              Waldek Hebisch

Date Sujet#  Auteur
11 Jun 25 * Memory protection between compilation units?53Mateusz Viste
11 Jun 25 +* Re: Memory protection between compilation units?6Josef Möllers
12 Jun 25 i+* Re: Memory protection between compilation units?2Michael S
13 Jun 25 ii`- Re: Memory protection between compilation units?1Mateusz Viste
12 Jun 25 i`* Re: Memory protection between compilation units?3Richard Heathfield
16 Jun 25 i `* Re: Memory protection between compilation units?2Rosario19
16 Jun 25 i  `- Re: Memory protection between compilation units?1Richard Heathfield
11 Jun 25 +- Re: Memory protection between compilation units?1Lew Pitcher
11 Jun 25 +* Re: Memory protection between compilation units?3David Brown
12 Jun 25 i`* Re: Memory protection between compilation units?2Mateusz Viste
12 Jun 25 i `- Re: Memory protection between compilation units?1David Brown
11 Jun 25 +* Re: Memory protection between compilation units?3Opus
11 Jun 25 i+- Re: Memory protection between compilation units?1wij
12 Jun 25 i`- Re: Memory protection between compilation units?1Mateusz Viste
11 Jun 25 +- Re: Memory protection between compilation units?1Kaz Kylheku
12 Jun 25 +* Re: Memory protection between compilation units?21Mateusz Viste
12 Jun 25 i`* Re: Memory protection between compilation units?20Kaz Kylheku
13 Jun 25 i +* Re: Memory protection between compilation units?2Mateusz Viste
13 Jun 25 i i`- Re: Memory protection between compilation units?1Kaz Kylheku
13 Jun 25 i `* Re: Memory protection between compilation units?17pozz
13 Jun 25 i  `* Re: Memory protection between compilation units?16Mateusz Viste
13 Jun 25 i   +* Re: Memory protection between compilation units?13Michael S
13 Jun 25 i   i+* Re: Memory protection between compilation units?2Richard Heathfield
14 Jun 25 i   ii`- Re: Memory protection between compilation units?1Michael S
13 Jun 25 i   i+- Re: Memory protection between compilation units?1Kaz Kylheku
14 Jun 25 i   i`* Re: Memory protection between compilation units?9Mateusz Viste
15 Jun 25 i   i `* Re: Memory protection between compilation units?8Waldek Hebisch
15 Jun 25 i   i  `* Re: Memory protection between compilation units?7Mateusz Viste
16 Jun 25 i   i   `* Re: Memory protection between compilation units?6Waldek Hebisch
16 Jun 25 i   i    +* Re: Memory protection between compilation units?3Kaz Kylheku
16 Jun 25 i   i    i`* Re: Memory protection between compilation units?2Waldek Hebisch
16 Jun 25 i   i    i `- Re: Memory protection between compilation units?1James Kuyper
16 Jun 25 i   i    `* Re: Memory protection between compilation units?2Tim Rentsch
16 Jun 25 i   i     `- Re: Memory protection between compilation units?1Waldek Hebisch
13 Jun 25 i   +- Re: Memory protection between compilation units?1Kaz Kylheku
13 Jun 25 i   `- Re: Memory protection between compilation units?1wij
12 Jun 25 +* Re: Memory protection between compilation units?2Mikko
12 Jun 25 i`- Re: Memory protection between compilation units?1Mateusz Viste
12 Jun 25 +* Re: Memory protection between compilation units?10Tim Rentsch
13 Jun 25 i+* Re: Memory protection between compilation units?5Bonita Montero
13 Jun 25 ii`* Re: Memory protection between compilation units?4wij
13 Jun 25 ii +- Re: Memory protection between compilation units?1Bonita Montero
13 Jun 25 ii `* Re: Memory protection between compilation units?2Keith Thompson
13 Jun 25 ii  `- Re: Memory protection between compilation units?1Tim Rentsch
13 Jun 25 i`* Re: Memory protection between compilation units?4Mateusz Viste
14 Jun 25 i `* Re: Memory protection between compilation units?3Tim Rentsch
14 Jun 25 i  `* Re: Memory protection between compilation units?2Mateusz Viste
1 Jul 25 i   `- Re: Memory protection between compilation units?1Tim Rentsch
13 Jun 25 +* Re: Memory protection between compilation units?3Bonita Montero
13 Jun 25 i`* Re: Memory protection between compilation units?2Mateusz Viste
13 Jun 25 i `- Re: Memory protection between compilation units?1Kaz Kylheku
16 Jun 25 +- Re: Memory protection between compilation units?1Mateusz Viste
21 Jun 25 `- Re: Memory protection between compilation units?1olcott

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal