[GRASS-SVN] r73982 - in grass/trunk/include: . defs

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 20 08:10:39 PST 2019


Author: marisn
Date: 2019-01-20 08:10:39 -0800 (Sun, 20 Jan 2019)
New Revision: 73982

Modified:
   grass/trunk/include/defs/imagery.h
   grass/trunk/include/gis.h
Log:
Introduce warn_unused_result macro


Modified: grass/trunk/include/defs/imagery.h
===================================================================
--- grass/trunk/include/defs/imagery.h	2019-01-20 16:05:19 UTC (rev 73981)
+++ grass/trunk/include/defs/imagery.h	2019-01-20 16:10:39 UTC (rev 73982)
@@ -164,7 +164,7 @@
 int I_SigSetNBands(struct SigSet *, int);
 struct ClassSig *I_NewClassSig(struct SigSet *);
 struct SubSig *I_NewSubSig(struct SigSet *, struct ClassSig *);
-int I_ReadSigSet(FILE *, struct SigSet *);
+int I_ReadSigSet(FILE *, struct SigSet *) WARN_UNUSED_RESULT;
 int I_SetSigTitle(struct SigSet *, const char *);
 const char *I_GetSigTitle(const struct SigSet *);
 int I_SetClassTitle(struct ClassSig *, const char *);

Modified: grass/trunk/include/gis.h
===================================================================
--- grass/trunk/include/gis.h	2019-01-20 16:05:19 UTC (rev 73981)
+++ grass/trunk/include/gis.h	2019-01-20 16:10:39 UTC (rev 73982)
@@ -67,6 +67,13 @@
 #  define HOST_NEWLINE "\n"
 #endif
 
+/*! \brief Generate warning if function return value is unused */
+#if __GNUC_PREREQ (3,4)
+    #define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
+#else
+    #define WARN_UNUSED_RESULT
+#endif
+
 /*!
   \brief List of units
 */



More information about the grass-commit mailing list