GRASS5.0beta2 fix for raster/r.mapcalc/polish

Eric G. Miller writes:

pol.y:43: warning: previous implicit declaration of `mapname'
pol.y:89: `storage' used prior to declaration

When I see "implicit declaration" I think, missing header include. I
haven't found the fix for this one. There seems to be a problem with the

The implicit declaration is because the header is #included in the C
code instead of the YACC part. The warning is harmless, but it can be
fixed by placing the following fragment at line 10 and deleting the
first three includes at line 79.

%{
#include <stdlib.h>
#include <string.h>
#include "local_proto.h"
%}

The error that stops the compile is the 'storage' declaration. This
can be fixed by moving the line that defines the 'storage' variable
up to just after the #include-s. Approx. Line 149 to Line 78.

The lines to move are:

static int nstored = 0;
static char **storage = 0;

This will allow the compile to proceed.

Bill Hughes

On 31 Jul, Bill Hughes wrote:
  | Eric G. Miller writes:
  | > pol.y:43: warning: previous implicit declaration of `mapname'
  | > pol.y:89: `storage' used prior to declaration
  |
  | > When I see "implicit declaration" I think, missing header include. I
  | > haven't found the fix for this one. There seems to be a problem with the
  |
  | The implicit declaration is because the header is #included in the C
  | code instead of the YACC part. The warning is harmless, but it can be
  | fixed by placing the following fragment at line 10 and deleting the
  | first three includes at line 79.
  |
  | %{
  | #include <stdlib.h>
  | #include <string.h>
  | #include "local_proto.h"
  | %}
  |
  |
  | The error that stops the compile is the 'storage' declaration. This
  | can be fixed by moving the line that defines the 'storage' variable
  | up to just after the #include-s. Approx. Line 149 to Line 78.
  |
  | The lines to move are:
  |
  | static int nstored = 0;
  | static char **storage = 0;
  |
  | This will allow the compile to proceed.
  |
  | Bill Hughes
  |

That mostly worked. I had to move that static declarations with the
#include-s

%{
#include <stdlib.h>
#include <string.h>
#include "local_proto.h"

static int nstored = 0;
static char **storage = 0;
%}

And then leave the #include "lex.yy.c" where it was. It then compiled
fine. Now onto the next error...
--

Eric G. Miller
Powered by the POTATO (http://www.debian.org)!