Emitting warnings on GCC

Is there a way that I could pass a string message as a warnign in GCC (but not as an ordinary message)?

Upvotes: 3

Views: 101

Answers (2)

Pawel Zubrycki
Pawel Zubrycki

Reputation: 2713

You could use warning about usunused variable for this - http://www.ideone.com/GyAMq

if(1 < 0) {
            char warning__1_Should_not_be_less_than_0;
    }

Upvotes: 1

sehe
sehe

Reputation: 393709

(googled:)

#error works and needs to, because the standard mandates it. gcc also has #warning.

Upvotes: 6

Related Questions