Skip to main content
t_j_l
Associate II
Dec 9, 2025 1:54 AM UTC
Question

sometimes some unnecessary #include statements automatically added.

When writing code, it is common to encounter the automatic inclusion of some unnecessary #include statements. For example, when I input "NULL" and press the Enter key, it will automatically add " #include <cstddef> ".5d4efb0c-42c5-4875-87f1-2af14162023c.png9e383e1b-8f6b-416c-b886-7a4e14d63698.png

8 replies

TDK
Dec 10, 2025 12:59 AM UTC

This is hard to follow. Where are you inputting NULL? Is this an autocomplete thing?

the IDE shows the file has been modified, but changing the file outside of user code blocks shouldn’t be done.

"If you feel a post has answered your question, please click ""Accept as Solution""."
t_j_l
t_j_lAuthor
Associate II
Dec 10, 2025 1:54 AM UTC

I entered "uint32_t *pi = NULL" in the user code section. When I pressed the Enter key while the code for handling the NULL input was being displayed, it automatically added "#include"

Andrew Neil
Super User
Dec 10, 2025 9:10 AM UTC

That seems a fairly reasonable thing to do: you've used NULL, so you will need a definition of it - it has just provided that definition for you.

What's the problem with that?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.