gmssl-v3-dev icon indicating copy to clipboard operation
gmssl-v3-dev copied to clipboard

fix gcc compile error: use option -std=c99 or -std=gnu99 to compile your…

Open taomaree opened this issue 3 years ago • 1 comments

fix gcc compile error below, add compile option -std=cc99.

src/des.c: In function 'permute':
src/des.c:188:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (size_t i = 0; i < n; i++) {
  ^
src/des.c:188:2: note: use option -std=c99 or -std=gnu99 to compile your code
make[2]: *** [CMakeFiles/gmssl.dir/build.make:588: CMakeFiles/gmssl.dir/src/des.c.o] Error 1

taomaree avatar Nov 21 '21 05:11 taomaree

CMakeLists.txt里面增加add_definitions(-std=c99)

Baymini-zx avatar Dec 29 '21 07:12 Baymini-zx