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


Groups > comp.lang.c > #387680

Re: on allowing "int a" definition everywhere

From Michael S <already5chosen@yahoo.com>
Newsgroups comp.lang.c
Subject Re: on allowing "int a" definition everywhere
Date 2024-08-21 16:54 +0300
Organization A noiseless patient Spider
Message-ID <20240821165454.000049f8@yahoo.com> (permalink)
References (1 earlier) <va2i90$3f4dg$1@dont-email.me> <pan$8a32c$1fb86219$8ea0c6ae$7c2d1765@invalid.invalid> <va4id0$3rc3n$1@dont-email.me> <va4mtb$3rvat$1@dont-email.me> <va4oeo$3s6p8$1@dont-email.me>

Show all headers | View raw


On Wed, 21 Aug 2024 10:01:12 -0300
Thiago Adams <thiago.adams@gmail.com> wrote:

> 
> For this type of error you need my static analyzer. (cake) :D
> 

Unnecessary. MSVC -W4 gives a warning.

#include <cstdio>

void foo()
{
  FILE* f = fopen("file1.txt", "r");
  if (FILE* f = fopen("file2.txt", "r")) {
    fclose(f);
  }
  if (f)
    fclose(f);
}


scopes.cpp(6): warning C4456: declaration of 'f' hides previous local
declaration scopes.cpp(5): note: see declaration of 'f'

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


Thread

on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-20 18:48 +0200
  Re: on allowing "int a" definition everywhere Thiago Adams <thiago.adams@gmail.com> - 2024-08-20 14:03 -0300
    Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-20 19:18 +0200
      Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-20 19:21 +0200
      Re: on allowing "int a" definition everywhere Thiago Adams <thiago.adams@gmail.com> - 2024-08-20 14:34 -0300
        Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-20 22:18 +0200
    Re: on allowing "int a" definition everywhere Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-08-21 04:42 +0000
      Re: on allowing "int a" definition everywhere Thiago Adams <thiago.adams@gmail.com> - 2024-08-21 08:17 -0300
        Re: on allowing "int a" definition everywhere Bart <bc@freeuk.com> - 2024-08-21 13:34 +0100
          Re: on allowing "int a" definition everywhere Thiago Adams <thiago.adams@gmail.com> - 2024-08-21 10:01 -0300
            Re: on allowing "int a" definition everywhere Michael S <already5chosen@yahoo.com> - 2024-08-21 16:54 +0300
              Re: on allowing "int a" definition everywhere Thiago Adams <thiago.adams@gmail.com> - 2024-08-21 11:21 -0300
        Re: on allowing "int a" definition everywhere Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-08-22 08:40 +0000
          Re: on allowing "int a" definition everywhere Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-08-22 02:21 -0700
            Re: on allowing "int a" definition everywhere Ben Bacarisse <ben@bsb.me.uk> - 2024-08-22 11:29 +0100
              Re: on allowing "int a" definition everywhere Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-08-22 11:12 -0700
              Re: on allowing "int a" definition everywhere Kaz Kylheku <643-408-1753@kylheku.com> - 2024-08-22 18:37 +0000
                Re: on allowing "int a" definition everywhere Ben Bacarisse <ben@bsb.me.uk> - 2024-08-23 00:39 +0100
          Re: on allowing "int a" definition everywhere Bart <bc@freeuk.com> - 2024-08-22 11:00 +0100
            Re: on allowing "int a" definition everywhere Thiago Adams <thiago.adams@gmail.com> - 2024-08-22 08:10 -0300
              Re: on allowing "int a" definition everywhere Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-08-22 17:06 +0000
            Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-23 12:47 +0200
              Re: on allowing "int a" definition everywhere Bart <bc@freeuk.com> - 2024-08-23 12:25 +0100
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-23 13:32 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-23 17:57 +0200
  Re: on allowing "int a" definition everywhere Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-08-21 03:30 +0000
    Re: on allowing "int a" definition everywhere Ben Bacarisse <ben@bsb.me.uk> - 2024-08-21 09:19 +0100
      Re: on allowing "int a" definition everywhere Ben Bacarisse <ben@bsb.me.uk> - 2024-08-21 10:11 +0100
    Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-25 12:40 +0200
      Re: on allowing "int a" definition everywhere Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-08-27 06:52 +0000
        Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 10:46 +0200
          Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 11:03 +0200
            Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 11:08 +0200
              Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 11:47 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 11:52 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 13:56 +0200
              Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 20:04 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 20:44 +0200
                Re: on allowing "int a" definition everywhere Bart <bc@freeuk.com> - 2024-08-27 19:59 +0100
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 21:36 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 22:02 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 23:42 +0200
                Re: on allowing "int a" definition everywhere Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-02 03:32 +0000
                Re: on allowing "int a" definition everywhere Bart <bc@freeuk.com> - 2024-09-02 10:53 +0100
                Re: on allowing "int a" definition everywhere Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 04:54 +0000
                Re: on allowing "int a" definition everywhere Kaz Kylheku <643-408-1753@kylheku.com> - 2024-09-03 06:12 +0000
                Re: on allowing "int a" definition everywhere Michael S <already5chosen@yahoo.com> - 2024-09-03 12:20 +0300
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-27 21:09 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-29 09:24 +0200
                Re: on allowing "int a" definition everywhere fir <fir@grunge.pl> - 2024-08-29 09:37 +0200
                Re: on allowing "int a" definition everywhere Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-09-03 04:56 +0000
        Re: on allowing "int a" definition everywhere Blue-Maned_Hawk <bluemanedhawk@invalid.invalid> - 2024-08-27 12:28 +0000
          Re: on allowing "int a" definition everywhere Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-08-27 18:45 -0700
            Re: on allowing "int a" definition everywhere Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-08-27 19:23 -0700
              Re: on allowing "int a" definition everywhere Ben Bacarisse <ben@bsb.me.uk> - 2024-08-28 15:28 +0100
                Re: on allowing "int a" definition everywhere Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-08-28 08:37 -0700
              Re: on allowing "int a" definition everywhere Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-08-28 08:22 -0700
                Re: on allowing "int a" definition everywhere Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-08-28 13:06 -0700
              Re: on allowing "int a" definition everywhere Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-08-28 09:31 -0700
                Re: on allowing "int a" definition everywhere David Brown <david.brown@hesbynett.no> - 2024-08-28 19:39 +0200
                Re: on allowing "int a" definition everywhere James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-08-28 14:34 -0400
                Re: on allowing "int a" definition everywhere Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-08-28 13:06 -0700

csiph-web