micmacIGN / micmac

Free open-source photogrammetry software tools
http://micmac.ensg.eu
Other
718 stars 153 forks source link

Fix GCC 13.2.1 compilation with -Werror #197

Open Silvanosky opened 2 years ago

Silvanosky commented 2 years ago

Mostly "maybe uninitialized" variable making the compilator not happy and use of pointer arithmetic with freed pointer which trigger compilation warning/error.

Need to check if graph cut reallocation code still used. If yes need to insure that the old freed pointer not used to suppress the compilation error.

Maybe others compiler will trigger other errors.

deseilligny commented 1 year ago

Je manque un peu de contexte, cela dit je vois pas cette ligne dans les ElFifo

De: "JM Muller" @.> À: "micmacIGN/micmac" @.> Cc: "Marc Pierrot-Deseilligny" @.>, "Review requested" @.> Envoyé: Jeudi 17 Août 2023 15:01:42 Objet: Re: [micmacIGN/micmac] Fix GCC 12.1.0 compilation with -Werror (PR #197)

@jmmuller commented on this pull request.

In [ https://github.com/micmacIGN/micmac/pull/197#discussion_r1296904213 | include/ext_stl/fifo.h ] :

@@ -197,6 +197,9 @@ template class ElFifo

     void incr_capa()
     {

Should be if (_capa < 1) _capa = 1;

in constructor?

In [ https://github.com/micmacIGN/micmac/pull/197#discussion_r1296908050 | src/uti_phgrm/GraphCut/QPBO-v1.4/QPBO.cpp ] :

@@ -202,7 +202,7 @@ template node_max[1] = nodes[1] + node_num_max; if (stage) {

  • memmove(nodes[1], (char)nodes[0] + ((char)nodes_old[1] - (char)nodes_old[0]), node_numsizeof(Node));

Why not declaring size here?

— Reply to this email directly, [ https://github.com/micmacIGN/micmac/pull/197#pullrequestreview-1582131015 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AFROVJQIAXQPAVFIGPIDJD3XVYI3NANCNFSM5YNVEMPA | unsubscribe ] . You are receiving this because your review was requested. Message ID: @.***>

jmmuller commented 1 year ago

Hello !

Charles a fait des corrections parce que son compilateur a un peu plus de warnings que nous. Il a fait une pull request pour ces modifs : https://github.com/micmacIGN/micmac/pull/197/files

Dans incr_capa() il a rajouté un test de _capa==0 et mise à 1 pour éviter les accidents. (Je ne sais pas quel message le compilateur lui a dit pour remarquer le problème). Je propose juste de passer ce test dans le constructeur parce que autant régler le pb tout de suite ?

De: "pierrot deseilligny" @.> À: "micmacIGN/micmac" @.> Cc: "Jean-Michael Muller" @.>, "Mention" @.> Envoyé: Jeudi 17 Août 2023 15:11:04 Objet: Re: [micmacIGN/micmac] Fix GCC 13.2.1 compilation with -Werror (PR #197)

Je manque un peu de contexte, cela dit je vois pas cette ligne dans les ElFifo

De: "JM Muller" @.> À: "micmacIGN/micmac" @.> Cc: "Marc Pierrot-Deseilligny" @.>, "Review requested" @.> Envoyé: Jeudi 17 Août 2023 15:01:42 Objet: Re: [micmacIGN/micmac] Fix GCC 12.1.0 compilation with -Werror (PR #197)

@jmmuller commented on this pull request.

In [ https://github.com/micmacIGN/micmac/pull/197#discussion_r1296904213 | include/ext_stl/fifo.h ] :

@@ -197,6 +197,9 @@ template class ElFifo

void incr_capa() {

Should be if (_capa < 1) _capa = 1;

in constructor?

In [ https://github.com/micmacIGN/micmac/pull/197#discussion_r1296908050 | src/uti_phgrm/GraphCut/QPBO-v1.4/QPBO.cpp ] :

@@ -202,7 +202,7 @@ template node_max[1] = nodes[1] + node_num_max; if (stage) {

  • memmove(nodes[1], (char)nodes[0] + ((char)nodes_old[1] - (char)nodes_old[0]), node_numsizeof(Node));

Why not declaring size here?

— Reply to this email directly, [ https://github.com/micmacIGN/micmac/pull/197#pullrequestreview-1582131015 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AFROVJQIAXQPAVFIGPIDJD3XVYI3NANCNFSM5YNVEMPA | unsubscribe ] . You are receiving this because your review was requested. Message ID: @.***>

— Reply to this email directly, [ https://github.com/micmacIGN/micmac/pull/197#issuecomment-1682261355 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AF3NYM4IRVNTY4K6H76YZMTXVYJ6RANCNFSM5YNVEMPA | unsubscribe ] . You are receiving this because you were mentioned. Message ID: @.***>