non-compiiled code check setting

已完成

I have a Makefile project that I compile multiple times with different macro definitions. I define these parameters in the Makefile under CFLAGS. However, my editor is not aware of this, so it marks a significant portion of my code as "non-compiled code."

Is it possible to manually set macros in the IDE? Or can I disable the "non-compiled code" check?

0

Hello!

I can't reproduce the issue in a simple project. 

I added -DFOO to CXXFLAGS in my Makefile and reloaded the project (Tools | Makefile | Reload Makefile Project), and it was correctly recognized in my source code - the code inside #ifdef FOO - #endif wasn't marked as non-compiled:

  1. How exactly do you define the parameters in Makefile?
  2. Is your project loaded in CLion without any issues? I.e. do you see any errors/warnings in the Build tool window if you do Tools | Makefile | Clean and Reload Makefile Project?
0

Hello

I define parameters like you: `-DFOO` in CFLAGS. 
I have issue for unsupported compiler:

Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.

I use avr-gcc compiller.

0
  1. Could you please share the entire output in which you see the warning?
  2. Please open any project source file in the editor, call Help | Diagnostics Tool | Show Compiler Infofrom the main menu, and share the entire output with us.
0

Yes, I can. 

This is entire out, which I see the warning, but It is useless, I think.

 Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
Unexpected compiler output.This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.

Compile project is OK. I have set Makefile Target and It is works.

Compiler info:

Compiler info for 'main.c' in configuration 'main.c' for language C

Compiler kind: GCC path: /usr/bin/avr-gcc

Compiler switches:
	-mmcu=attiny406
	-B
	../src/attiny_pack/gcc/dev/attiny406/
	-I
	../src/port
	-I
	../src
	-I
	../src/modbus/rtu
	-I
	../src/modbus/ascii
	-I
	../src/modbus/include
	-I
	../src/led_controller
	-Wall
	-gstabs
	-DF_CPU=20000000L
	-Os
	-Wall
	-Wstrict-prototypes
	-I
	../src/attiny_pack/include/
	-DF_CPU=20000000L
	-Wp,-M,-MP,-MT,main.o,-MF,dep/main.o.d
	-DFW_TYPE=0x0001
	-DMB_ENABLE
	-DPX_ENABLE
	-c

Compiler info:

Defines:
#define __extension__
#define __builtin_va_start(list, paramN) ((void)(list = sizeof(paramN)))
#define __builtin_va_arg(list, type) ((type)list)
#define __builtin_va_end(list) ((void)list)
#define __builtin_va_copy(dest, src) ((void)(dest = src))
#define __builtin_offsetof(type, member) ((size_t)(&(((type *)0)->member)))
#define __builtin_types_compatible_p(X,Y) 1
#define __builtin_choose_expr(C,T,E) T

Features:
	CXX_ALTERNATIVE_OPERATORS=false
	MISSING_RETURN_FROM_NON_VOID=WARNING

Implicit includes:


Header Search paths:
	Pointer: file:///home/hell/CLionProjects/led-string-controller-fw/src/port
	Pointer: file:///home/hell/CLionProjects/led-string-controller-fw/src
	Pointer: file:///home/hell/CLionProjects/led-string-controller-fw/src/modbus/rtu
	Pointer
	Pointer: file:///home/hell/CLionProjects/led-string-controller-fw/src/modbus/include
	Pointer: file:///home/hell/CLionProjects/led-string-controller-fw/src/led_controller
	Pointer: file:///home/hell/CLionProjects/led-string-controller-fw/src/attiny_pack/include
	Pointer: file:///usr/lib/gcc/avr/5.4.0/include
	Pointer: file:///usr/lib/gcc/avr/5.4.0/include-fixed
	Pointer: file:///usr/lib/avr/include

My define is ‘MB_ENABLE’. Its here, but in my code is MB_ENABLE market still as non-compile.

0

I installed gcc-avr, binutils-avr, and avr-libc in my Ubuntu Docker container, and I can't reproduce the “Unexpected compiler output. This compiler might be unsupported” warning with a simple Makefile project and the avr-gcc compiler:

Also -DFOO is correctly recognized in the code:

  1. Where do you see the “Unexpected compiler output. This compiler might be unsupported” warning? Please share a screenshot.
  2. Could you please create a simple project and check if you get the “Unexpected compiler output. This compiler might be unsupported” warning in it?
0

OK, I find problematic line in Makefile:

CFLAGS += -Wp,-M,-MP,-MT,$(*F).o,-MF,dep/$(@F).d

If I remove this line, everything works fine without any errors. I dont need this feature, so my problem is solved. Thanks you!

-----

1. The error message was in the notifications:

0

请先登录再写评论。