C++ assert implementation in assert.h

后端 未结 4 1668
灰色年华
灰色年华 2020-12-16 18:05
00001 /* assert.h
00002    Copyright (C) 2001, 2003 Free Software Foundation, Inc.
00003    Written by Stephane Carrez (stcarrez@nerim.fr)       
00004 
00005 This f         


        
4条回答
  •  太阳男子
    2020-12-16 18:37

    It suppresses compiler warnings about unused values or variables.

    Also note the comma operator on the right, which makes both sides of the || something that's convertible to bool.

    __assert is an internal function that will presumably print a message and implement the required assertion behaviour (i.e. call abort()).

提交回复
热议问题