Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #399571

Re: Using gotos with local variables in "extra" blocks: Does it get deallocated?

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Using gotos with local variables in "extra" blocks: Does it get deallocated?
Date 2026-05-31 16:24 -0700
Organization A noiseless patient Spider
Message-ID <86h5nnduxq.fsf@linuxsc.com> (permalink)
References <10v1jrr$35gqh$2@news.xmission.com> <10v1toh$qrb$1@reader1.panix.com> <DY%QR.370372$gO1.309583@fx14.iad> <10v49pt$3fq$2@reader1.panix.com> <iukRR.470241$gO1.114156@fx14.iad>

Show all headers | View raw


scott@slp53.sl.home (Scott Lurndal) writes:

[asking about when the storage for local variables in
 nested blocks will be deallocated]

> Experimenting with gcc (4.8.3, 14.2.1) shows that the
> stack layout depends on -O.

Sure.  Isn't that what anyone would expect?  (Not meant
rhetorically.)

> int fff(int yyy, int xxx)
> {
>     int ab = yyy + xxx;
>
>     {
>        int bb;
>        printf("%p\n", &bb);
>     }
>
>     {
>        int bc;
>        printf("%p\n", &bc);
>     }
>
>     printf("%p\n", &ab);
>
>     return 0;
> }

This function has undefined behavior.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Using gotos with local variables in "extra" blocks: Does it get deallocated? gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-25 13:46 +0000
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-25 16:19 +0200
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Bart <bc@freeuk.com> - 2026-05-25 15:21 +0100
    The C23 thing (Was: Using gotos with local variables in "extra" blocks: Does it get) deallocated? gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-25 14:32 +0000
    Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-25 16:34 +0200
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Andrew Smallshaw <andrews@sdf.org> - 2026-05-25 16:09 +0000
    The whole point of this NG is worrying about "UB" (Was: Using gotos with local variables in "extra" blocks: Does it get) deallocated? gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-25 16:54 +0000
      Re: The whole point of this NG is worrying about "UB" (Was: Using gotos with local variables in "extra" blocks: Does it get) deallocated? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-05-25 19:08 +0200
        Re: The whole point of this NG is worrying about "UB" (Was: Using gotos with local variables in "extra" blocks: Does it get) deallocated? gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-25 17:23 +0000
          Re: The whole point of this NG is worrying about "UB" (Was: Using gotos with local variables in "extra" blocks: Does it get) deallocated? Bart <bc@freeuk.com> - 2026-05-25 18:48 +0100
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-25 16:35 +0000
    Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? scott@slp53.sl.home (Scott Lurndal) - 2026-05-25 17:49 +0000
      Variables in inner blocks (was: Using gotos with local variables in "extra" blocks: Does it get deallocated?) pa@see.signature.invalid (Pierre Asselin) - 2026-05-25 19:52 +0000
      Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-26 14:13 +0000
        Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? scott@slp53.sl.home (Scott Lurndal) - 2026-05-26 17:10 +0000
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? David Brown <david.brown@hesbynett.no> - 2026-05-26 20:31 +0200
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-05-31 16:24 -0700
            Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-31 16:36 -0700
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? David Brown <david.brown@hesbynett.no> - 2026-05-25 18:40 +0200
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-05-26 17:14 -0500
    Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-27 00:23 +0000
      Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? gazelle@shell.xmission.com (Kenny McCormack) - 2026-05-27 02:09 +0000
      Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Lynn McGuire <lynnmcguire5@gmail.com> - 2026-05-26 22:51 -0500
        Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-27 04:46 +0000
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? David Brown <david.brown@hesbynett.no> - 2026-05-27 09:21 +0200
        Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? cross@spitfire.i.gajendra.net (Dan Cross) - 2026-05-27 12:40 +0000
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? scott@slp53.sl.home (Scott Lurndal) - 2026-05-27 14:48 +0000
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-27 13:39 -0700
            Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-05-27 17:04 -0700
              Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-27 18:16 -0700
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? antispam@fricas.org (Waldek Hebisch) - 2026-05-28 00:35 +0000
            Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2026-05-29 04:01 +0100
        Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-05-27 13:32 -0700
  Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? fir <profesor.fir@gmail.com> - 2026-05-27 15:33 +0200
    Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Bart <bc@freeuk.com> - 2026-05-27 17:18 +0100
      Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? fir <profesor.fir@gmail.com> - 2026-05-27 18:51 +0200
        Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? fir <profesor.fir@gmail.com> - 2026-05-27 18:56 +0200
    Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-27 22:42 +0000
      Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? fir <profesor.fir@gmail.com> - 2026-05-28 07:33 +0200
        Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-28 05:37 +0000
          Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? fir <profesor.fir@gmail.com> - 2026-05-28 17:35 +0200
            Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? Bart <bc@freeuk.com> - 2026-05-28 16:49 +0100
              Re: Using gotos with local variables in "extra" blocks: Does it get deallocated? fir <profesor.fir@gmail.com> - 2026-05-28 18:04 +0200

csiph-web