# Macro defined with undefined typedef enums

**URL:** <https://verificationacademy.com/forums/t/macro-defined-with-undefined-typedef-enums/36618>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, define, enum\
**Created:** [October 1, 2019, 4:21pm UTC](https://verificationacademy.com/forums/t/macro-defined-with-undefined-typedef-enums/36618 "2019-10-01T16:21:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agstod](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@agstod](https://verificationacademy.com/forums/u/agstod)\
**Post date:** [October 1, 2019, 4:21pm UTC](https://verificationacademy.com/forums/t/macro-defined-with-undefined-typedef-enums/36618/1 "2019-10-01T16:21:28Z")

</div>

For any macro definition, is it true that the contents are not evaluated unless I actually use the macro somewhere else later in the code?

I.e. will this code

```verilog

`define ABC(X)\
    (SOME_UNDEFINED_ENUM == X ? ANOTHER_UNDEFINED_ENUM : YET_ANOTHER_UNDEFINED_ENUM)

```

compile even if I never define a typedef enum so long as I never use the `ABC macro anywhere in my code?

---

<div class="post-metadata">

**Author:** ![sbellock](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@sbellock](https://verificationacademy.com/forums/u/sbellock)\
**Post date:** [October 1, 2019, 5:02pm UTC](https://verificationacademy.com/forums/t/macro-defined-with-undefined-typedef-enums/36618/2 "2019-10-01T17:02:00Z")

</div>

Correct. Preprocessor text substitution takes place before compilation.
