xuxin930 commented on code in PR #14159:
URL: https://github.com/apache/nuttx/pull/14159#discussion_r1797626983


##########
tools/Config.mk:
##########
@@ -732,6 +732,9 @@ export DEFINE_PREFIX ?= $(subst X,,${shell $(DEFINE) 
"$(CC)" X 2> ${EMPTYFILE}})
 export INCDIR_PREFIX ?= $(subst "X",,${shell $(INCDIR) "$(CC)" X 2> 
${EMPTYFILE}})
 export INCSYSDIR_PREFIX ?= $(subst "X",,${shell $(INCDIR) -s "$(CC)" X 2> 
${EMPTYFILE}})
 
+# Get the GCC version number
+export GCCVER = $(shell $(CXX) --version | grep ++ | sed -E 's/.* 
([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)

Review Comment:
   ```suggestion
   ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU), y)
     export GCCVER = $(shell $(CC) --version | grep ++ | sed -E 's/.* 
([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
   endif
   ```



##########
arch/arm/src/cmake/gcc.cmake:
##########
@@ -62,7 +62,7 @@ endif()
 # array subscript [0] is outside array bounds:
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
 
-execute_process(COMMAND ${CMAKE_C_COMPILER} --version
+execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version

Review Comment:
   ```suggestion
   execute_process(COMMAND ${CMAKE_C_COMPILER} --version
                   OUTPUT_VARIABLE GCC_VERSION_OUTPUT)
   string(REGEX MATCH "\\+\\+.* ([0-9]+)\\.[0-9]+" GCC_VERSION_REGEX
                "${GCC_VERSION_OUTPUT}")
   set(GCCVER ${CMAKE_MATCH_1} PARENT_SCOPE)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to