Hi,

I'm currently trying to check whether two macros are equal to each other. The idea is to generate different code, when they are equal, which basically means that they are connected to the same port.

Basically it looks something like this:

#define LED1_DDR DDRD
#define LED2_DDR DDRD
#if LED1_DDR == LED2_DDR
  // Code
#endif

But when trying to compile this, I get the following error:

error: operator '*' has no left operand

Interestingly enough it works just fine, when the values of the macros are not some sort of macro itself, but a literal, e.g. "one". It then just compiles fine.

Could anyone explain this to me? Is there any way around this (still using macros)?

Best regards,
Karol Babioch

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to