Page MenuHomePhabricator

efl_check.h: Replace stack allocated array by heap allocated
ClosedPublic

Authored by walac on Jun 12 2020, 11:40 AM.

Details

Summary

clang-cl doesn't support the syntax of dynamic stack allocated arrays.

ref: windows-native-port

Co-authored-by: Lucas <Coquinho@users.noreply.github.com>

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
walac created this revision.Jun 12 2020, 11:40 AM
walac requested review of this revision.Jun 12 2020, 11:40 AM

or alloca() ? Normally, it is correctly declares (see eina_alloca.h)

walac updated this revision to Diff 30631.Jun 12 2020, 1:53 PM

Replace malloc by alloca

you shouldn't free from alloca

felipealmeida requested changes to this revision.Jun 12 2020, 2:04 PM
This revision now requires changes to proceed.Jun 12 2020, 2:04 PM
felipealmeida accepted this revision.Jun 12 2020, 2:08 PM

was I seeing an older version in my browser?

This revision is now accepted and ready to land.Jun 12 2020, 2:08 PM
stefan_schmidt requested changes to this revision.Jun 15 2020, 12:52 AM
stefan_schmidt added a subscriber: stefan_schmidt.

Gettign of a tons of errors with this patch and cxx bindings enabled. One example (there are more):

[219/398] Compiling C++ object 'src/tests/eina_cxx/6b3491e@@eina_cxx_suite@exe/eina_cxx_suite.cc.o'
In file included from ../src/tests/eina_cxx/eina_cxx_suite.h:8,
                 from ../src/tests/eina_cxx/eina_cxx_suite.cc:20:
../src/tests/eina_cxx/../efl_check.h: In function ‘int _efl_test_option_disp(int, char**, const Efl_Test_Case*)’:
../src/tests/eina_cxx/../efl_check.h:137:23: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  137 |              nav[0] = "valgrind";
      |                       ^~~~~~~~~~
../src/tests/eina_cxx/../efl_check.h:138:23: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  138 |              nav[1] = "--trace-children=yes";
This revision now requires changes to proceed.Jun 15 2020, 12:52 AM
walac updated this revision to Diff 30641.Jun 15 2020, 5:27 AM

Make C++ compiler happy

Fix warnings in C++ bindings.

walac added a comment.Jun 15 2020, 5:30 AM

Gettign of a tons of errors with this patch and cxx bindings enabled. One example (there are more):

[219/398] Compiling C++ object 'src/tests/eina_cxx/6b3491e@@eina_cxx_suite@exe/eina_cxx_suite.cc.o'
In file included from ../src/tests/eina_cxx/eina_cxx_suite.h:8,
                 from ../src/tests/eina_cxx/eina_cxx_suite.cc:20:
../src/tests/eina_cxx/../efl_check.h: In function ‘int _efl_test_option_disp(int, char**, const Efl_Test_Case*)’:
../src/tests/eina_cxx/../efl_check.h:137:23: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  137 |              nav[0] = "valgrind";
      |                       ^~~~~~~~~~
../src/tests/eina_cxx/../efl_check.h:138:23: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  138 |              nav[1] = "--trace-children=yes";

Thank you for pointing this out. I update the patch to fix it.

stefan_schmidt accepted this revision.Jun 23 2020, 8:20 AM
This revision is now accepted and ready to land.Jun 23 2020, 8:20 AM
Closed by commit rEFL3cf052af3389: efl_check.h: Replace stack allocated array by heap allocated (authored by Joao Antonio Cardoso <joao.antonio@expertisesolutions.com.br>, committed by stefan_schmidt). · Explain WhyJun 23 2020, 8:21 AM
This revision was automatically updated to reflect the committed changes.