Bug 29313 - [middle-end]Possible bogus warning: argument 'type' might be clobbered
Summary: [middle-end]Possible bogus warning: argument 'type' might be clobbered
Status: RESOLVED DUPLICATE of bug 41219
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-01 23:46 UTC by Jerry DeLisle
Modified: 2009-12-29 15:48 UTC (History)
6 users (show)

See Also:
Host: linux-ppc, darwin-ppc, linux-x86_64
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2006-10-01 23:46:19 UTC
This warning occurs for libgfortran/io/list_read.c (list_formatted_read_scalar)

It can be cleared up using the 'volatile' on the argument 'type' shown here.  'type' is never changed anywhere.

static void
list_formatted_read_scalar (st_parameter_dt *dtp, volatile bt type, void *p, int kind,
			    size_t size)
{
  char c;
  int m;
  jmp_buf eof_jump;

  dtp->u.p.namelist_mode = 0;

  dtp->u.p.eof_jump = &eof_jump;
  if (setjmp (eof_jump))
    {
      generate_error (&dtp->common, ERROR_END, NULL);
      goto cleanup;
    }

 --- snip ---
Comment 1 Jerry DeLisle 2006-10-01 23:50:13 UTC
From the gfortran list:

         Reviewing my buildlog of gcc trunk on Darwin PPC, I noticed
we have the warning...

/sw/src/fink.build/gcc4-4.1.9999-20060928/darwin_objdir/./gcc/xgcc -B/sw/src/fink.build/gcc4-4.1.9999-20060928/darwin_objdir/./gcc/ -B/sw/lib/gcc4/powerpc-apple-darwin8/bin/ -B/sw/li
b/gcc4/powerpc-apple-darwin8/lib/ -isystem /sw/lib/gcc4/powerpc-apple-darwin8/include -isystem /sw/lib/gcc4/powerpc-apple-darwin8/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.2-2
0060928/libgfortran -I. -iquote../../../gcc-4.2-20060928/libgfortran/io -I../../../gcc-4.2-20060928/libgfortran/../gcc -I../../../gcc-4.2-20060928/libgfortran/../gcc/config -I../../.
/gcc -D_GNU_SOURCE -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -O2 -g -O2 -c ../../../gcc-4.2-20060928/libgfortran/io/lis
t_read.c  -fno-common -DPIC -o .libs/list_read.o
../../../gcc-4.2-20060928/libgfortran/io/list_read.c: In function 'list_formatted_read_scalar':
../../../gcc-4.2-20060928/libgfortran/io/list_read.c:1460: warning: argument 'type' might be clobbered by 'longjmp' or 'vfork'
Comment 2 Francois-Xavier Coudert 2009-12-29 15:48:55 UTC

*** This bug has been marked as a duplicate of 41219 ***