"Untyped variable" bug???

From: Bob Carragher (bob_at_fla.fujitsu.com)
Date: Wed Aug 19 1998 - 01:52:44 BST


Hello,

I'm not sure whether this is a bug or a "feature."  It appears
that there may be a problem with the way ups handles global
variables.  Specifically, sometimes ups cannot figure out the
type of a global variable.

At the bottom of this message, I have appended a copy of a C
program.  In it, I define (using "typedef") a new data type,
and declare one global variable of that type and one local
(to main()) variable of that type.  When I run ups and stop
the program and try to inspect these variables, ups will list
the local variable under the "main" entry under "Functions,"
and the global variable under the "Untyped variables" section.

I am working with gcc 2.7.2.2 under Sun Solaris 2.5.1 on a
Sun Ultra-2 (2 x 200MHz processors) with 1 GB of RAM.  The
ups version is 3.32.1 (the one that contains, among others,
the patch for another bug I pointed out ^_^;;;).

Here are the steps I used to generate the bug/feature:

     (1)  Start ups on the executable with no arguments.
          E.g.

               ups a.out

     (2)  Add a breakpoint just before the "for" loop.

     (3)  Start ups.  When it stops, click on global
          variable "table" and local-to-main() variable
          "second_table."

     (4)  You should see "table" listed under the "Untyped
          variables" section of the ups display, and
          "second_table" listed under the "main" in the
          "Functions" section of the ups display.

If you have any questions or need more information, please let
me know!  Thanks!

				Bob Carragher

------------------------------Cut Here------------------------------

typedef struct _temp
{
  char *command;
} one_command;

one_command table[5];

void main()
{
  int i;
  one_command second_table[5];


  for (i = 0; i < 5; i++) {
    table[i].command = (char *) malloc(100);
  }
}


This archive was generated by hypermail 2.1.4 : Wed Feb 13 2002 - 21:51:32 GMT