Skip to content
Snippets Groups Projects
Commit 45c50b6a authored by Mark Wielaard's avatar Mark Wielaard
Browse files

Suggest including <stdbool.h> for bool, true and false

Currently gcc suggests to use _Bool instead of bool and doesn't give
any suggestions when true or false are used, but undefined. This patch
makes it so that (for C99 or higher) a fixit hint is emitted to include
<stdbool.h>.

gcc/c-family/ChangeLog:

	* known-headers.cc (get_stdlib_header_for_name): Return
	"<stdbool.h>" for "bool", "true" or "false" when STDLIB_C and
	flag_isoc99.

gcc/testsuite/ChangeLog:

	* gcc.dg/spellcheck-stdbool.c: New test.
parent 72af65b9
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment