# Spurious compilation error due to incorrect sketch preprocessing

**URL:** <https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995>\
**Category:** IDE 2.x\
**Created:** [June 11, 2026, 4:34am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995 "2026-06-11T04:34:47Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvb333007](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/vvb333007/32/974521_2.png) [@vvb333007](https://forum.arduino.cc/u/vvb333007)\
**Post date:** [June 11, 2026, 4:34am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/1 "2026-06-11T04:34:47Z")

</div>

This old feature is still present in Arduino IDE 2.3.10:

Target: ESP32S3 Dev Module, but I suspect other architectures are also affected:

```cpp
#include <Arduino.h>
//extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv); { // Uncomment me to fix the issue
extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv) {

  return 0;
}

void setup() {
  
  Serial.begin(115200);

}

void loop() {

  delay(1000);
}

```

Compiler output (line numbers are wrong because I removed comments from the source file before posting):

```processing
D:\Arduino\espshell\espshell.ino:56:18: error: conflicting declaration of 'void setup()' with 'C' linkage
   56 | void setup() {
      | ^    
In file included from D:\Arduino\espshell\espshell.ino:5:
C:\Users\WINDOWS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.10\cores\esp32/Arduino.h:155:6: note: previous declaration with 'C++' linkage
  155 | void setup(void);
      | ^ ~~~~
D:\Arduino\espshell\espshell.ino:63:18: error: conflicting declaration of 'void loop()' with 'C' linkage
   63 | void loop() {
      | ^   
C:\Users\WINDOWS\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.10\cores\esp32/Arduino.h:156:6: note: previous declaration with 'C++' linkage
  156 | void loop(void);
      | ^~~~
exit status 1

```

This code is the real code. The function of interest is declared as weak symbol in another library, thats why it is declared in this way

---

<div class="post-metadata">

**Author:** ![vvb333007](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/vvb333007/32/974521_2.png) [@vvb333007](https://forum.arduino.cc/u/vvb333007)\
**Post date:** [June 11, 2026, 4:42am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/2 "2026-06-11T04:42:23Z")

</div>

Oh I forgot to post the autogenerated .ino.cpp

Enjoy:

```cpp
#line 38 "D:\\Arduino\\espshell\\espshell.ino"
 extern "C" int cmd_misc_user(int _Argc, char **_Argv);
#line 56 "D:\\Arduino\\espshell\\espshell.ino"
 extern "C" void setup();
#line 63 "D:\\Arduino\\espshell\\espshell.ino"
 extern "C" void loop();
#line 38 "D:\\Arduino\\espshell\\espshell.ino"
extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv) {

```

This all can actually be fixed in one move: just add a checkbox to the IDE's preferences : "[\*] Autogenerate function forward declarations", keep it ON by default.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 11, 2026, 5:19am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/3 "2026-06-11T05:19:39Z")

</div>

> [@vvb333007](#):
>
> but I suspect other architectures are also affected:

I compiled the code for an Arduino Mega without issues. Compiling for the ESP32 shows indeed the issue.  
I did compare the ino.cpp files for both scenarios and they are the same.  
I also compiled for a Teensy 4.1 without problems; I did not compare the ino.cpp.

Sounds more like a compiler bug to me.

If you want to continue a discussion I suggest that you start a new topic.

PS  
I could not find an ESP32S3 Dev Module in the list of supported boards, only a _ESP32S3 Dev Module Octal (WROOM2)_ which I used for the test.

```plaintext
FQBN: esp32:esp32:esp32s3-octal

```

---

<div class="post-metadata">

**Author:** ![vvb333007](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/vvb333007/32/974521_2.png) [@vvb333007](https://forum.arduino.cc/u/vvb333007)\
**Post date:** [June 11, 2026, 6:01am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/4 "2026-06-11T06:01:27Z")

</div>

> [@sterretje](#):
>
> I did compare the ino.cpp files for both scenarios and they are the same.

Do you mean they also have `extern "C" setup();` but compile with no errors?

---

<div class="post-metadata">

**Author:** ![kenb4](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kenb4](https://forum.arduino.cc/u/kenb4)\
**Post date:** [June 11, 2026, 6:12am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/5 "2026-06-11T06:12:08Z")

</div>

> [@sterretje](#):
>
> I could not find an ESP32S3 Dev Module in the list of supported boards

I happen to have **esp32** board version 3.3.7 here

```bash
$ cd ~/.arduino15/packages/esp32/hardware/esp32/3.3.7/
$ sed -nE 's/.*\.name=(ESP32.+Dev Module)$/\1/p' boards.txt | LC_ALL=C sort
ESP32 Dev Module
ESP32C2 Dev Module
ESP32C3 Dev Module
ESP32C5 Dev Module
ESP32C6 Dev Module
ESP32C61 Dev Module
ESP32H2 Dev Module
ESP32P4 Dev Module
ESP32S2 Dev Module
ESP32S3 Dev Module

```

Listed, and not hidden

```bash
$ grep -B 1 'hide=true' boards.txt
esp32_family.name=ESP32 Family Device
esp32_family.hide=true
--
esp32c2.name=ESP32C2 Dev Module
esp32c2.hide=true
--
esp32c61.name=ESP32C61 Dev Module
esp32c61.hide=true

```

It's fifth in the menu in the IDE. Just plain ESP32 is 8th.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 11, 2026, 6:36am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/6 "2026-06-11T06:36:59Z")

</div>

> [@Arduino IDE 2.3.10 is now available](https://forum.arduino.cc/t/arduino-ide-2-3-10-is-now-available/1447778/26):
>
> I happen to have **esp32** board version 3.3.7 here

I forgot to mention, it's version 3.3.10.

> [@vvb333007](#):
>
> Do you mean they also have `extern "C" setup();` but compile with no errors?

I took your code; this is the ino.cpp generated for the Mega

```cpp
#line 1 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
#include <Arduino.h>
//extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv); { // Uncomment me to fix the issue
#line 3 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
 extern "C" int cmd_misc_user(int _Argc, char **_Argv);
#line 9 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
 extern "C" void setup();
#line 16 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
 extern "C" void loop();
#line 3 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv) {

  return 0;
}

void setup() {
  
  Serial.begin(115200);

}

void loop() {

  delay(1000);
}

```

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 11, 2026, 7:04am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/7 "2026-06-11T07:04:10Z")

</div>

Downgraded the ESP32 board package to 3.3.7 and selected the ESP32S3 Dev Module.  
Generated ino.cpp (just so you can compare directly with the Mega's ino.cpp).

```cpp
#line 1 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
#include <Arduino.h>
//extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv); { // Uncomment me to fix the issue
#line 3 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
 extern "C" int cmd_misc_user(int _Argc, char **_Argv);
#line 9 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
 extern "C" void setup();
#line 16 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
 extern "C" void loop();
#line 3 "C:\\Users\\bugge\\OneDrive\\Documents\\Arduino\\1_forum.arduino.cc\\1447778\\1447778.post22\\1447778.post22.ino"
extern "C" __attribute__ ((used)) int cmd_misc_user(int _Argc, char **_Argv) {

  return 0;
}

void setup() {
  
  Serial.begin(115200);

}

void loop() {

  delay(1000);
}

```

---

<div class="post-metadata">

**Author:** ![vvb333007](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/vvb333007/32/974521_2.png) [@vvb333007](https://forum.arduino.cc/u/vvb333007)\
**Post date:** [June 11, 2026, 9:47am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/8 "2026-06-11T09:47:20Z")

</div>

So it is wrong. I mean your generated code for mega is wrong. Arduino has added `extern "C" ` to C++ functions `loop()` and `setup()`

Just as I expected - other architectures are also affected. Since it affects more tham one Arch it should be reported I think

---

<div class="post-metadata">

**Author:** ![vvb333007](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/vvb333007/32/974521_2.png) [@vvb333007](https://forum.arduino.cc/u/vvb333007)\
**Post date:** [June 11, 2026, 9:51am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/9 "2026-06-11T09:51:02Z")

</div>

> [@sterretje](#):
>
> `extern "C" void setup();`

Must not be like that. `setup()` has C++ linkage.

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [June 11, 2026, 9:58am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/10 "2026-06-11T09:58:22Z")

</div>

Since the discussion is tangential to the subject of [the original topic](https://forum.arduino.cc/t/arduino-ide-2-3-10-is-now-available/1447778), I split this interesting and valuable conversation off to a dedicated forum topic.

Please carry on with discussion of the sketch preprocessor problem here.

Discussion on other subjects directly related to the Arduino IDE 2.3.10 release announcement can be conducted in [the other topic](https://forum.arduino.cc/t/arduino-ide-2-3-10-is-now-available/1447778).

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [June 11, 2026, 10:02am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/11 "2026-06-11T10:02:14Z")

</div>

Thanks for your report @vvb333007. The Arduino developers are tracking the bug here:

> <https://github.com/arduino/arduino-cli/issues/1618>
>
> \### Describe the problem
> 
> Compiling the following blink sketch for ESP32 board:
> …
> \`\`\`C++
> \#ifdef \_\_cplusplus
> extern "C"
> {
> \#endif
> 
> void dummy(void) {}
> 
> \#ifdef \_\_cplusplus
> }
> \#endif
> 
> void setup()
> {
> pinMode(LED\_BUILTIN, OUTPUT);
> }
> 
> void loop()
> {
> digitalWrite(LED\_BUILTIN, HIGH);
> delay(1000);
> digitalWrite(LED\_BUILTIN, LOW);
> delay(1000);
> }
> \`\`\`
> 
> results in errors:
> 
> \`\`\`txt
> sketch\_esp32\_blink:12:12: error: conflicting declaration of 'void setup()' with 'C' linkage
> void setup()
> ^
> In file included from /tmp/arduino\_build\_620310/sketch/sketch\_esp32\_blink.ino.cpp:1:0:
> .arduino15/packages/esp32/hardware/esp32/1.0.6/cores/esp32/Arduino.h:118:6: note: previous declaration with 'C++' linkage
> void setup(void);
> ^
> sketch\_esp32\_blink:17:11: error: conflicting declaration of 'void loop()' with 'C' linkage
> void loop()
> ^
> In file included from /tmp/arduino\_build\_620310/sketch/sketch\_esp32\_blink.ino.cpp:1:0:
> .arduino15/packages/esp32/hardware/esp32/1.0.6/cores/esp32/Arduino.h:119:6: note: previous declaration with 'C++' linkage
> void loop(void);
> ^
> exit status 1
> conflicting declaration of 'void setup()' with 'C' linkage
> \`\`\`
> 
> \### Arduino CLI version
> 
> \#### Original report
> 
> Arduino IDE 1.8.19
> 
> \#### Last verified with
> 
> 60c1c98
> 
> \### Operating system
> 
> \- Linux
> \- Windows
> 
> \### Operating system version
> 
> \- Ubuntu 21.10 
> \- Windows 11
> 
> \### Additional context
> 
> If the \`extern "C" { ... }\` block does not define any function but only variables, or if the whole \`extern "C" { ... }\` block is moved after the definition of \`setup\` and \`loop\` functions, the code compiles successfully. 
> 
> If the \`extern "C" { ... }\` block only declares functions, and functions are defined in a separate module (file), everything compiles correctly.
> 
> The files with \`.cpp\` extensions do not have this problem, and allow mixing \`C\` linkage functions defined within \`extern "C" { ... }\` blocks.
> 
> Looks like, when the compiler encounters a \`C\` linkage function definition in a sketch file (\`.ino\` extension), it assumes that the rest of file defines only \`C\` linkage functions. 
> 
> The error can not be reproduced when compiling for boards using AVR or ARM processors that I could test with.
> 
> \#### Additional reports
> 
> \- https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995
> 
> \#### Related
> 
> \- https://github.com/arduino/arduino-cli/issues/1591
> 
> \### Issue checklist
> 
> \- \[X\] I searched for previous reports in \[the issue tracker\](https://github.com/arduino/arduino-cli/issues?q=)
> \- \[X\] I verified the problem still occurs when using the \[nightly build\](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
> \- \[X\] My report contains all necessary details

---

<div class="post-metadata">

**Author:** ![vvb333007](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/vvb333007/32/974521_2.png) [@vvb333007](https://forum.arduino.cc/u/vvb333007)\
**Post date:** [June 11, 2026, 3:07pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/12 "2026-06-11T15:07:05Z")

</div>

Opened: 2022, Imperfection :-). No way they going to fix it. Imperfections are low-prio things :).

---

<div class="post-metadata">

**Author:** ![costycnc](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/costycnc/32/1278653_2.png) [@costycnc](https://forum.arduino.cc/u/costycnc)\
**Post date:** [June 11, 2026, 3:23pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/13 "2026-06-11T15:23:51Z")

</div>

Hi vvb333007, you've touched on a crucial point. The IDE and its preprocessor sometimes create issues like yours because they hide what's happening "under the hood."

This is exactly why I created **avr-compiler-js** ( [GitHub - costycnc/avr-compiler-js: A fully online tool, no installation needed. · GitHub](https://github.com/costycnc/avr-compiler-js) ). It's not "better" or "worse" than the IDE. It's **different**. It's an approach I call **"The Wooden Toy Philosophy"** :

**For an absolute beginner:**

- No installation: open your browser and type `sbi 5,5` → the D13 LED turns on.
- No `pinMode()`, no `setup()`, no `loop()`.
- You immediately see that pin D13 is "connector 5 of box 5" (PORTB, bit 5). You understand it with your eyes, not with abstractions.

**For your specific problem:**  
In my tool, there is **no preprocessor** rewriting your code. What you write is exactly what the compiler sees. So errors like yours **cannot happen**. It's pure Assembly , no magic.

**The key point I want to make** (and this answers your original question, vvb333007):  
Your error happens because the IDE tries to "help" you but ends up confusing you. My experience with **CostyCNC** taught me that:

1. **First** , you let beginners touch the registers directly (SBI 5,5, CBI 5,5, OUT, IN...)
2. **Then** , once they understand that a register is just a set of ON/OFF switches, they can use abstractions like `digitalWrite()`.

If a beginner starts with `digitalWrite()`, "pin 13" is just magic words to them. If they start with `sbi 5,5`, they understand that pin D13 is **bit 5 of PORTB register**. A switch. No magic.

### Practical conclusion :

Try writing your code like this (without any preprocessor interference):

```c
// No #include <Arduino.h>
// No forced setup/loop

void setup(void) {
    // Your code here
}

void loop(void) {
    // Your code here
}

```

Compile it with avr-compiler-js or with avr-gcc from the command line. You'll see the `conflicting declaration` error disappears because no one is rewriting your code behind your back.

**My invitation to everyone:** Don't be afraid to open the "hood" of the car. AVR registers aren't difficult. They're just lots of tiny switches. And `sbi 5,5` is the key to turning on the light inside the engine.

_P.S. I keep some notes and examples at [costycnc.it/avr1](https://costycnc.it/avr1)_

Happy coding to all!

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 11, 2026, 5:40pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/14 "2026-06-11T17:40:59Z")

</div>

I am afraid that you are looking at things from a position os knowledge. When you say

> [@costycnc](#):
>
> If they start with `sbi 5,5`, they understand that pin D13 is **bit 5 of PORTB register**.

how does the beginner know that pin 13 is bit 5 or PORTB ?  
What is sbi ?  
Which of the 5's relates to the bit number and what does the other 5 mean ?  
Where is the relationship between PORTB and pin 13 established ?

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [June 11, 2026, 7:23pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/15 "2026-06-11T19:23:38Z")

</div>

> [@vvb333007](#):
>
> Imperfections are low-prio things

You jumped to a false conclusion. The " **type: imperfection**" label identifies items related to any defect whatsoever. The name was intentionally chosen to be applicable to any component of the project, at any severity on the spectrum from "missing comma in the readme" to "[Skynet](https://en.wikipedia.org/wiki/Skynet_(Terminator)) is waging war on humanity".

The label does not in any way indicate level of priority. We have a separate set of " **priority**" labels for that purpose. " **priority**" labels are assigned by a manager during the planning process, while " **type**" labels are assigned by a maintainer during triage.

This labeling schema was developed based on over a decade of maintaining the issue trackers of hundreds of open source repositories.

I am a maintainer, so I assigned the issue the appropriate " **type: imperfection**" label. I am not a manager of the Arduino CLI project, so I am not in a role to assign priority to the issue.

---

<div class="post-metadata">

**Author:** ![costycnc](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/costycnc/32/1278653_2.png) [@costycnc](https://forum.arduino.cc/u/costycnc)\
**Post date:** [June 14, 2026, 10:43am UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/16 "2026-06-14T10:43:08Z")

</div>

> [@costycnc](#):
>
> `sbi 5,5`, they understand that pin D13 is **bit 5 of PORTB register**. A switch. No mag

i did , the mcu have registers and bit not portb and pb5, when write asm you touch wires.

That is exactly the point.

Of course, this approach is **purely educational**. It is not meant for writing massive or intensive production code. It is strictly for learning.

Starting with online tools, without installing anything and just writing `sbi 5,5` without even knowing how to program, takes only 10 minutes. A beginner types it, the LED turns on, and they immediately understand the physical connection. No magic.

Compare this to the traditional Arduino way:

1. You must download and install a heavy IDE.
2. You must learn C syntax before doing anything.
3. Beginners just copy and paste the "Blink" sketch.

This gives them the fake impression that they are programmers, but they actually understand nothing about what is happening under the hood.

Touching the raw registers directly removes the fake magic. It teaches the real hardware from minute one.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 14, 2026, 12:54pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/17 "2026-06-14T12:54:36Z")

</div>

Let's try not to derail the topic with posts that are irrelevant to the topic.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [June 14, 2026, 5:01pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/18 "2026-06-14T17:01:50Z")

</div>

> [@costycnc](#):
>
> they immediately understand the physical connection

I am willing to bet they don't  
Here they are with a Uno 3 board with a pin labelled 13. A beginner writes a HIGH value to pin 13 and the LED turns on. Simple

Do they need to know or care about ports and bits in ports ? No, of course not

This is my last word on the subject in this topic for the reason suggested by @sterretje but I could not let your contentious post go without commenting

---

<div class="post-metadata">

**Author:** ![Rintin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/rintin/32/1013044_2.png) [@Rintin](https://forum.arduino.cc/u/Rintin)\
**Post date:** [June 14, 2026, 5:57pm UTC](https://forum.arduino.cc/t/spurious-compilation-error-due-to-incorrect-sketch-preprocessing/1447995/19 "2026-06-14T17:57:04Z")

</div>

You can work around the errors by moving the offending code to separate header and cpp files.
