[PROJ] build failure with GCC 9.1.0

Even Rouault even.rouault at spatialys.com
Wed Sep 25 01:49:22 PDT 2019


> I am afraid it is not enough. Please find attached 4 additional patches :
> 
>      - proj-6.2.0-hanato.gpatch and proj-6.2.0-mbtfpp.gpatch
> 
> In files src/projections/hatano.cpp and src/projections/mbtfpp.cpp,
> change the CS define to CSz in order to avoid overriding the CS system
> definition

ok for those ones.

> 
>      - proj-6.2.0-isea.gpatch :
> 
> In file src/projections/isea.cpp, change the quad variable name as it is
> overriding another system definition
> 
> $ grep quad  /usr/include/sys/types.h
> typedef struct _quad { int val[2]; } quad_t;    /* used by UFS */
> typedef quad_t          quad;                   /* used by UFS */
> 

I'm quite surprised about that one. The compiler should be smart enough to see 
that in "int quad;" quad is a variable name, not a struct. Which error message 
do you get exactly ?

Can you try to compile the following test.cpp file ?

```
typedef struct _quad { int val[2]; } quad_t;    /* used by UFS */
typedef quad_t          quad;                   /* used by UFS */

struct foo
{
    int quad;
};

int main()
{
    int quad = 0;
    return quad;
}
```

$ g++ -std=c++11 test.cpp -c

Works fine on Linux. If adding, -Wshadow, it will complain though about the 
int quad = 0 shadowing the global declaration of typedef quad_t quad;


>      - proj-6.2.0-io.gpatch

It is essentially the same as my pull request, or am I missing somethig ?

> Note : I quite understood what I changed in the first 3 patches. Not
> sure in the last one. Can you please review it ?

Which one do you mean by the last one, the one for io.cpp ?

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list