You can silence the warning (if you know what you do) or you can detect and treat the undef-case. However, it is wise to keep the no warnings; scope small.
Update: See also johngg's hint below about the do{ ... } trick.

When in doubt, I suggest to treat the undef-case, and let the warning pragma do its job.
Often, an undef warning reveals a bug that was otherwise undetected.