arg-nonnull.h 1.2 KB

1234567891011121314151617181920212223242526
  1. /* A C macro for declaring that specific arguments must not be NULL.
  2. Copyright (C) 2009-2011 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify it
  4. under the terms of the GNU General Public License as published
  5. by the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
  14. that the values passed as arguments n, ..., m must be non-NULL pointers.
  15. n = 1 stands for the first argument, n = 2 for the second argument etc. */
  16. #ifndef _GL_ARG_NONNULL
  17. # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
  18. # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
  19. # else
  20. # define _GL_ARG_NONNULL(params)
  21. # endif
  22. #endif