Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 53031c2 in mainline


Ignore:
Timestamp:
2015-06-01T00:49:17Z (5 years ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
eab9689
Parents:
193d280c
Message:

add annotations for static checks

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/include/memstr.h

    r193d280c r53031c2  
    3636
    3737extern void *memcpy(void *, const void *, size_t)
    38     __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
     38    __attribute__((nonnull(1, 2)))
     39    __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
    3940extern void *memset(void *, int, size_t)
    40     __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
    41 extern void *memmove(void *, const void *, size_t);
     41    __attribute__((nonnull(1)))
     42    __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
     43extern void *memmove(void *, const void *, size_t)
     44    __attribute__((nonnull(1, 2)));
    4245
    4346#endif
  • kernel/generic/include/lib/memfnc.h

    r193d280c r53031c2  
    4646
    4747extern void *memset(void *, int, size_t)
     48    __attribute__((nonnull(1)))
    4849    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns") DO_NOT_DISCARD;
    4950extern void *memcpy(void *, const void *, size_t)
     51    __attribute__((nonnull(1, 2)))
    5052    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns") DO_NOT_DISCARD;
    5153
  • kernel/generic/include/memstr.h

    r193d280c r53031c2  
    4848#define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
    4949
    50 extern void memsetb(void *, size_t, uint8_t);
    51 extern void memsetw(void *, size_t, uint16_t);
    52 extern void *memmove(void *, const void *, size_t) DO_NOT_DISCARD;
     50extern void memsetb(void *, size_t, uint8_t)
     51    __attribute__((nonnull(1)));
     52extern void memsetw(void *, size_t, uint16_t)
     53    __attribute__((nonnull(1)));
     54extern void *memmove(void *, const void *, size_t)
     55    __attribute__((nonnull(1, 2))) DO_NOT_DISCARD;
    5356
    5457#endif
  • kernel/generic/include/mm/slab.h

    r193d280c r53031c2  
    142142extern void *malloc(size_t, unsigned int)
    143143    __attribute__((malloc));
    144 extern void *realloc(void *, size_t, unsigned int);
     144extern void *realloc(void *, size_t, unsigned int)
     145    __attribute__((warn_unused_result));
    145146extern void free(void *);
    146147
  • uspace/lib/c/include/malloc.h

    r193d280c r53031c2  
    4444extern void *memalign(const size_t align, const size_t size)
    4545    __attribute__((malloc));
    46 extern void *realloc(const void *addr, const size_t size);
     46extern void *realloc(const void *addr, const size_t size)
     47    __attribute__((warn_unused_result));
    4748extern void free(const void *addr);
    4849extern void *heap_check(void);
  • uspace/lib/c/include/mem.h

    r193d280c r53031c2  
    4040
    4141extern void *memset(void *, int, size_t)
     42    __attribute__((nonnull(1)))
    4243    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
    4344extern void *memcpy(void *, const void *, size_t)
     45    __attribute__((nonnull(1, 2)))
    4446    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
    45 extern void *memmove(void *, const void *, size_t);
    46 extern int memcmp(const void *, const void *, size_t);
     47extern void *memmove(void *, const void *, size_t)
     48    __attribute__((nonnull(1, 2)));
     49extern int memcmp(const void *, const void *, size_t)
     50    __attribute__((nonnull(1, 2)));
    4751
    4852#endif
  • uspace/lib/c/include/task.h

    r193d280c r53031c2  
    6060extern int task_spawn(task_id_t *, task_wait_t *, const char *path, int,
    6161    va_list ap);
    62 extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...);
     62extern int task_spawnl(task_id_t *, task_wait_t *, const char *path, ...)
     63    __attribute__((sentinel));
    6364
    6465extern int task_setup_wait(task_id_t, task_wait_t *);
  • uspace/lib/posix/include/posix/stdlib.h

    r193d280c r53031c2  
    116116
    117117/* Memory Allocation */
    118 extern void *__POSIX_DEF__(malloc)(size_t size);
    119 extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize);
    120 extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size);
     118extern void *__POSIX_DEF__(malloc)(size_t size)
     119    __attribute__((malloc));
     120extern void *__POSIX_DEF__(calloc)(size_t nelem, size_t elsize)
     121    __attribute__((malloc));
     122extern void *__POSIX_DEF__(realloc)(void *ptr, size_t size)
     123    __attribute__((warn_unused_result));
    121124extern void __POSIX_DEF__(free)(void *ptr);
    122125
  • uspace/lib/posix/include/posix/string.h

    r193d280c r53031c2  
    6767/* From mem.h */
    6868// #define bzero(ptr, len)  memset((ptr), 0, (len))
    69 extern void *memset(void *, int, size_t);
    70 extern void *memcpy(void *, const void *, size_t);
    71 extern void *memmove(void *, const void *, size_t);
     69extern void *memset(void *, int, size_t)
     70    __attribute__((nonnull(1)));
     71extern void *memcpy(void *, const void *, size_t)
     72    __attribute__((nonnull(1, 2)));
     73extern void *memmove(void *, const void *, size_t)
     74    __attribute__((nonnull(1, 2)));
    7275
    7376
Note: See TracChangeset for help on using the changeset viewer.