Issue compiling marlin firmware "expected primary expression ')' before token"

Arduino: 1.8.12 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

sketch\Marlin_main.cpp:2108:36: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]

LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

sketch\Marlin_main.cpp: In function 'void setup_powerhold()':

fastio.h:32:37: error: expected primary-expression before ')' token

#define _WRITE_C(IO, v) do { if (v) { \

^

sketch\fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

sketch\fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch\Marlin_main.cpp:411:4: note: in expansion of macro 'WRITE'

WRITE(PS_ON_PIN, PS_ON_AWAKE);

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

fastio.h:30:37: error: expected primary-expression before ')' token

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

sketch\fastio.h:45:105: note: in expansion of macro '_WRITE_NC'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

sketch\fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch\Marlin_main.cpp:411:4: note: in expansion of macro 'WRITE'

WRITE(PS_ON_PIN, PS_ON_AWAKE);

^

sketch\Marlin_main.cpp: In function 'void set_bed_level_equation_lsq(double*)':

sketch\Marlin_main.cpp:873:36: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

planeNormal.debug("planeNormal");

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

sketch\Marlin_main.cpp: In function 'void process_commands()':

fastio.h:32:37: error: expected primary-expression before ')' token

#define _WRITE_C(IO, v) do { if (v) { \

^

sketch\fastio.h:45:80: note: in expansion of macro '_WRITE_C'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

sketch\fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch\Marlin_main.cpp:2072:9: note: in expansion of macro 'WRITE'

WRITE(PS_ON_PIN, PS_ON_AWAKE);

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

fastio.h:30:37: error: expected primary-expression before ')' token

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

sketch\fastio.h:45:105: note: in expansion of macro '_WRITE_NC'

#define _WRITE(IO, v) do { if (&(DIO ## IO ## _RPORT) >= (uint8_t *)0x100) {_WRITE_C(IO, v); } else {_WRITE_NC(IO, v); }; } while (0)

^

sketch\fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch\Marlin_main.cpp:2072:9: note: in expansion of macro 'WRITE'

WRITE(PS_ON_PIN, PS_ON_AWAKE);

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

Marlin_main.cpp:2104:26: error: 'PS_ON_ASLEEP' was not declared in this scope

WRITE(PS_ON_PIN, PS_ON_ASLEEP);

^

sketch\fastio.h:32:36: note: in definition of macro '_WRITE_C'

#define _WRITE_C(IO, v) do { if (v) { \

^

sketch\fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch\Marlin_main.cpp:2104:9: note: in expansion of macro 'WRITE'

WRITE(PS_ON_PIN, PS_ON_ASLEEP);

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

Marlin_main.cpp:2104:26: error: 'PS_ON_ASLEEP' was not declared in this scope

WRITE(PS_ON_PIN, PS_ON_ASLEEP);

^

sketch\fastio.h:30:36: note: in definition of macro '_WRITE_NC'

#define _WRITE_NC(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0)

^

sketch\fastio.h:68:23: note: in expansion of macro '_WRITE'

#define WRITE(IO, v) _WRITE(IO, v)

^

sketch\Marlin_main.cpp:2104:9: note: in expansion of macro 'WRITE'

WRITE(PS_ON_PIN, PS_ON_ASLEEP);

^

sketch\Marlin_main.cpp: In function 'void clamp_to_software_endstops(float*)':

Marlin_main.cpp:3326:7: error: 'min_software_endstops' was not declared in this scope

if (min_software_endstops) {

^

Marlin_main.cpp:3332:7: error: 'max_software_endstops' was not declared in this scope

if (max_software_endstops) {

^

exit status 1
expected primary-expression before ')' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Just clone the latest code from github (2.0.6) and it compiled fine (although tons of warnings which doesn't indicate a good code quality).

So I guess you either got an older code version or configured your IDE incorrectly.