[PROJ] build failure with GCC 9.1.0
Dechaux Eric CEN (BCQ STIG)
eric.dechaux at gendarmerie.interieur.gouv.fr
Wed Sep 25 05:09:06 PDT 2019
Le 25/09/2019 à 10:49, Even Rouault a écrit :
>> 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;
This exact code does not produce any error or warning. With -Wshadow
enabled, it produce the followingoutput :
$ g++ -std=c++11 test.cpp -o test -Wshadow
test.cpp: In function 'int main()':
test.cpp:11:9: warning: declaration of 'quad' shadows a global
declaration [-Wshadow]
11 | int quad = 0;
| ^~~~
test.cpp:2:25: note: shadowed declaration is here
2 | typedef quad_t quad; /* used by UFS */
| ^~~~
The patch only removes the warning.
>
>
>> - 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 ?
Yes, io.ccp. The patch applies above your pull request and change the CS
class name in two templates
template <class TargetCRS, class DatumBuilderType,
class CS = CoordinateSystem>
util::nn<std::shared_ptr<TargetCRS>>
and
template <class TargetCRS, class BaseCRS, class CS = CoordinateSystem>
--
Eric
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: avertissement.txt
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20190925/38a5bcb8/attachment-0001.txt>
More information about the PROJ
mailing list