HomePhabricator

fix warnings: expression result unused [-Wunused-value]
ecf1c79aada2Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

fix warnings: expression result unused [-Wunused-value]

In the assert()s take advantage of the fact that string constants
("string") are effectively of type 'const char []', which when used in
an expression yield a non-NULL pointer.

An assertion that should always fail can thus be formulated as:

assert(!"fail);

An assertion where a text message should be added to the expression can
be written as such:

assert("message" && expression);

Signed-off-by: Giel van Schijndel <me@mortis.eu>

Details

Provenance
Giel van Schijndel <me@mortis.eu>Authored on Jun 24 2011, 17:56
schancelPushed on Jan 5 2018, 21:58
schancelPushed on Jan 5 2018, 21:39
schancelPushed on Jan 5 2018, 21:17
Parents
rSTAGINGdf4018141752: fix warning on 64bit systems: cast to pointer from integer of different size…
Branches
Unknown
Tags
Unknown

Event Timeline

Giel van Schijndel <me@mortis.eu> committed rSTAGINGecf1c79aada2: fix warnings: expression result unused [-Wunused-value] (authored by Giel van Schijndel <me@mortis.eu>).Jul 13 2011, 03:07