我创建了一个函数
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<form action="/tasks/19" method="post">
<input type="submit" value="Save" />
<br>
<label for="id_task_name">Task name:</label>
<input style="width: 100%" id="id_task_name" maxlength="400" name="task_name" type="text" value="sample task" />
<label for="id_repeat_type">Repeat type:</label>
<select id="id_repeat_type" name="repeat_type">
<option value="NR" selected="selected">No Repeat</option>
<option value="IA">Repeat After X Days</option>
<option value="IE">Repeat Every X Days</option>
</select>
<div id="repeat-options">
<label for="id_repeat_days">Days between instances:</label>
<input id="id_repeat_days" name="repeat_days" type="number" />
</div>
<br>
<input type="submit" value="Save" />
</form>
然后运行CppCheck。它没有抱怨没有退货声明,如果它抱怨也是合理的。
为什么?