assert()与assert_options()用法说明

本文详细介绍了PHP中的assert断言功能,包括assert()函数如何工作、如何配置assert行为以及通过示例展示不同设置下assert的表现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如题,我只是在这里说一下我自己的理解,解释不是特别官方。

希望能帮助大家理解。
注意:
assert()失败就相当于,assert()检测到false.


bool assert(mixed $assertion)
assert()是检查$assertion是否返回false。$assertion一般是一个表达式或函数。assert()返回值如果检测了false则返回false,否则返回true。


与assert()配套使用的还有assert_options()这个函数。
mixed assert_options(int $what [,mixed $value])
assert_options()用于控制assert()执行时一些选项。

参数:
$what值如下:

OptionPHP.ini中对应的选项默认值     Description
ASSERT_ACTIVE assert.active 1 允许使用assert().
ASSERT_WARNING assert.warning 1 在assert失败时输出warning警告信息。
ASSERT_BAIL assert.bail 0 assert失败后终止代码执行。
ASSERT_QUIET_EVAL assert.quiet_eval 0 在assert代码运行中禁止使用error_reporting。
ASSERT_CALLBACK assert.callback (NULL) assert()执行失败,吊用指定内容。

 

(一)
function test_assert($parameter)
{
   assert(is_int($parameter));
 
}
test_assert(1.2);

 

很简单的代码,is_int($parameter)返回值是false,assert()检测到false(即assert失败)并返回一个warning提示,这个提示不属于系统错误,是assert()自己自动加上的一个提示,指明assert()检测到false值的代码所在位置。如图:

assert()与assert_options()用法说明

如果我给assert()加上几个参数,来控制让它在检测到false时,不提示warning提示这时可以用assert_optiong(ASSERT_WARNTNG,0);如下:
<?php
assert_options(ASSERT_WARNING,0);
function test_assert($parameter)
{
   assert(is_int($parameter));
   echo 'assert is ok';
 
}
test_assert(1.2);

?>
运行结果是只显示:assert is ok

 

(二)
<?php
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_ACTIVE,   1);//允许使用assert()函数

,默认是true.
assert_options(ASSERT_BAIL,     1);
function test_assert($parameter)
{
   echo 'strat<br/>';
   assert(is_int($parameter));
   echo 'assert is ok';
 
}
test_assert(1.2);

?>
运行结果是:strat

后面并未输出assert is ok。这是ASSERT_BAIL的作用。当assert()返回false时,终止执行代码。

 


(三)
<?php
error_reporting(E_ALL);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_ACTIVE,   1);
assert_options(ASSERT_BAIL,     1);
//assert_options(ASSERT_CALLBACK, 'assert_failure');
//assert_options(ASSERT_QUIET_EVAL, 1);
function assert_failure()
{
    echo 'Assert failed';
}
function test_assert($parameter)
{
 echo 'strat<br/>';
   assert('mysql_query("")');
   echo 'assert is ok';
 
}
test_assert(4);
?>
运行结果如下图:

assert()与assert_options()用法说明


很明示这里的mysql_query("")是不正确的,一定会出现一些系统提示错误(error_reporting)。但如果你想关闭这些信息,就可以使用ASSERT_QUIET_EVAL,增加语句:assert_options(ASSERT_QUIET_EVAL, 1);
最后说明一下,

assert_options(ASSERT_CALLBACK, 'assert_failure');
它的作用就是把当assert()检测到false时,启用某个函数。
在上例中加上assert_options(ASSERT_CALLBACK, 'assert_failure');
再运行结果如下图:

assert()与assert_options()用法说明

 


Build started: Project: iSO-STM32 *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target '代码模板' compiling main.c... ..\..\User\main.c(3): error: #5: cannot open source input file "lcd.h": No such file or directory #include "lcd.h" ..\..\User\main.c: 0 warnings, 1 error compiling system_stm32f10x.c... compiling misc.c... ..\..\Libraries\FWlib\src\misc.c(99): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_NVIC_PRIORITY_GROUP(NVIC_PriorityGroup)); ..\..\Libraries\FWlib\src\misc.c(117): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd)); ..\..\Libraries\FWlib\src\misc.c(159): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_NVIC_VECTTAB(NVIC_VectTab)); ..\..\Libraries\FWlib\src\misc.c(178): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_NVIC_LP(LowPowerMode)); ..\..\Libraries\FWlib\src\misc.c(202): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource)); ..\..\Libraries\FWlib\src\misc.c: 5 warnings, 0 errors compiling stm32f10x_rcc.c... ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(273): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_HSE(RCC_HSE)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(338): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(357): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(383): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PLL_SOURCE(RCC_PLLSource)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(404): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(568): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_SYSCLK_SOURCE(RCC_SYSCLKSource)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(612): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_HCLK(RCC_SYSCLK)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(638): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PCLK(RCC_HCLK)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(664): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PCLK(RCC_HCLK)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(703): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_IT(RCC_IT)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(731): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_USBCLK_SOURCE(RCC_USBCLKSource)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(770): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_ADCCLK(RCC_PCLK2)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(832): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_LSE(RCC_LSE)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(865): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(882): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_RTCCLK_SOURCE(RCC_RTCCLKSource)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(896): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1067): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_AHB_PERIPH(RCC_AHBPeriph)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1098): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1129): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1188): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1219): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1240): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1253): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1285): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_MCO(RCC_MCO)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1332): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_FLAG(RCC_FLAG)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1406): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_GET_IT(RCC_IT)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c(1451): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_CLEAR_IT(RCC_IT)); ..\..\Libraries\FWlib\src\stm32f10x_rcc.c: 27 warnings, 0 errors compiling stm32f10x_gpio.c... ..\..\Libraries\src\stm32f10x_gpio.c(111): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(178): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(286): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(308): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(324): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(346): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(361): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(377): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(397): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(420): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(437): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\src\stm32f10x_gpio.c(466): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource)); ..\..\Libraries\src\stm32f10x_gpio.c(486): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_gpio.c(554): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_REMAP(GPIO_Remap)); ..\..\Libraries\src\stm32f10x_gpio.c(613): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource)); ..\..\Libraries\src\stm32f10x_gpio.c(632): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_MediaInterface)); ..\..\Libraries\src\stm32f10x_gpio.c: 16 warnings, 0 errors compiling stm32f10x_rcc.c... ..\..\Libraries\src\stm32f10x_rcc.c(273): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_HSE(RCC_HSE)); ..\..\Libraries\src\stm32f10x_rcc.c(338): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_CALIBRATION_VALUE(HSICalibrationValue)); ..\..\Libraries\src\stm32f10x_rcc.c(357): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_rcc.c(383): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PLL_SOURCE(RCC_PLLSource)); ..\..\Libraries\src\stm32f10x_rcc.c(404): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_rcc.c(568): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_SYSCLK_SOURCE(RCC_SYSCLKSource)); ..\..\Libraries\src\stm32f10x_rcc.c(612): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_HCLK(RCC_SYSCLK)); ..\..\Libraries\src\stm32f10x_rcc.c(638): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PCLK(RCC_HCLK)); ..\..\Libraries\src\stm32f10x_rcc.c(664): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_PCLK(RCC_HCLK)); ..\..\Libraries\src\stm32f10x_rcc.c(703): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_IT(RCC_IT)); ..\..\Libraries\src\stm32f10x_rcc.c(731): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_USBCLK_SOURCE(RCC_USBCLKSource)); ..\..\Libraries\src\stm32f10x_rcc.c(770): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_ADCCLK(RCC_PCLK2)); ..\..\Libraries\src\stm32f10x_rcc.c(832): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_LSE(RCC_LSE)); ..\..\Libraries\src\stm32f10x_rcc.c(865): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_rcc.c(882): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_RTCCLK_SOURCE(RCC_RTCCLKSource)); ..\..\Libraries\src\stm32f10x_rcc.c(896): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_rcc.c(1067): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_AHB_PERIPH(RCC_AHBPeriph)); ..\..\Libraries\src\stm32f10x_rcc.c(1098): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); ..\..\Libraries\src\stm32f10x_rcc.c(1129): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); ..\..\Libraries\src\stm32f10x_rcc.c(1188): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB2_PERIPH(RCC_APB2Periph)); ..\..\Libraries\src\stm32f10x_rcc.c(1219): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_APB1_PERIPH(RCC_APB1Periph)); ..\..\Libraries\src\stm32f10x_rcc.c(1240): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_rcc.c(1253): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\src\stm32f10x_rcc.c(1285): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_MCO(RCC_MCO)); ..\..\Libraries\src\stm32f10x_rcc.c(1332): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_FLAG(RCC_FLAG)); ..\..\Libraries\src\stm32f10x_rcc.c(1406): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_GET_IT(RCC_IT)); ..\..\Libraries\src\stm32f10x_rcc.c(1451): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_RCC_CLEAR_IT(RCC_IT)); ..\..\Libraries\src\stm32f10x_rcc.c: 27 warnings, 0 errors compiling stm32f10x_gpio.c... ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(111): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(178): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(286): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(308): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(324): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(346): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(361): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(377): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(397): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(420): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(437): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(466): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(486): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_FUNCTIONAL_STATE(NewState)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(554): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_REMAP(GPIO_Remap)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(613): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c(632): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_GPIO_ETH_MEDIA_INTERFACE(GPIO_ETH_MediaInterface)); ..\..\Libraries\FWlib\src\stm32f10x_gpio.c: 16 warnings, 0 errors compiling core_cm3.c... compiling stm32f10x_tim.c... ..\..\Libraries\src\stm32f10x_tim.c(125): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(231): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(284): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(367): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(449): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(528): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(590): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_CHANNEL(TIM_ICInitStruct->TIM_Channel)); ..\..\Libraries\src\stm32f10x_tim.c(659): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(715): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST2_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(809): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(834): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST2_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(875): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(912): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(940): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST4_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(967): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST9_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(992): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1011): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1039): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1080): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1121): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1153): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1179): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1203): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1233): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1272): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST5_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1319): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1343): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1367): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1391): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1412): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1436): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST2_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1461): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST4_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1486): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST5_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1513): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1538): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1562): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1586): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1610): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1636): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1661): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1686): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1711): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1737): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1761): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1785): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1809): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1832): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST2_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1856): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1879): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST1_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1903): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1927): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST1_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1951): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(1979): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2009): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST2_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2051): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2095): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2123): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2147): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2173): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2205): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST7_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2228): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2249): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2267): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2281): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2295): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2309): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2323): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2337): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2356): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2378): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2400): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2422): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2444): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2460): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST8_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2473): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST6_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2486): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2499): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_LIST3_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2512): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2525): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2560): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2603): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2637): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c(2679): warning: #223-D: function "assert_param" declared implicitly assert_param(IS_TIM_ALL_PERIPH(TIMx)); ..\..\Libraries\src\stm32f10x_tim.c: 83 warnings, 0 errors "..\..\Output\Hex_ZH.axf" - 1 Error(s), 174 Warning(s). Target not created. Build Time Elapsed: 00:00:02
最新发布
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值