Author Topic: Why is NULL not highlighted?  (Read 401 times)

Offline konjina

  • Multiple posting newcomer
  • *
  • Posts: 18
Why is NULL not highlighted?
« on: March 31, 2018, 03:21:39 am »
Basically what's in the title.

Is there a particular reason for this keyword not to be highlighted?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10904
    • Travis build status
Re: Why is NULL not highlighted?
« Reply #1 on: March 31, 2018, 10:53:45 am »
It is not a keyword, it is a macro.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline konjina

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Why is NULL not highlighted?
« Reply #2 on: April 02, 2018, 09:44:09 am »
It is not a keyword, it is a macro.

My bad, sorry.

In any case, I think it should be highlighted. Every other IDE/Text editor does it. It's quite useful to have stand out.

Offline gd_on

  • Regular
  • ***
  • Posts: 412
Re: Why is NULL not highlighted?
« Reply #3 on: April 02, 2018, 11:03:26 am »
if NULL is used for a pointer, you can replace it by nullptr, which is highligthed.

gd_on
Windows 10 or 7, svn C::B (last version or almost!), WxWidgets 2.8.12, Compilers TDM 4.9.2 32 bits (gcc and gfortran installed in C:\MinGW32). Tests with C::B 64 bits and WxWidgets 2.8.12 or 3.1.1 (64 bits) compiled by TDM 4.9.2 in C:\MinGW64

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10904
    • Travis build status
Re: Why is NULL not highlighted?
« Reply #4 on: April 02, 2018, 04:04:41 pm »
In any case, I think it should be highlighted. Every other IDE/Text editor does it. It's quite useful to have stand out.
You can always add it to your list of keywords in the syntax highlight settings for c/c++ lexer in the Editor settings.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]