Я искал в документации Splint термин «свежее хранилище» и нашел упоминание об этом, но не нашел формального определения. Другие модификаторы, такие как null или only, я понимаю и использую. Я просто не уверен, что такое свежее хранилище.
Ситуация такова:
void output_system_information(unsigned int frequency, unsigned int duration) {
unsigned int intervals = duration/frequency;
/* here I allocate some storage */
System * my_system = malloc(sizeof(System));
SystemInfo* current, * total;
if (my_system == NULL) {
fprintf(stderr, "%s\n", "Aborting: failed malloc in output_system_informatioin");
exit(EXIT_FAILURE);
}
/* and here I initialize is in that function */
init_system(my_system);
total = tally_system_info(frequency, duration, my_system);
current = my_system->get_system_info();
/* Here I've removed a ton of print-line statements so that you don't have to see them */
/* then the members and the struct get freed in this here dtor */
delete_system(my_system);
free(current);
free(total);
return;
}
Это домашнее задание, но этот вопрос не имеет прямого отношения к домашнему заданию. Это вопрос о шпильке.