hi, the __attribute__ ((__deprecated__)) feature of gcc can help us to remember what things will become useless.
I attach a patch with an example. I've used config.h because is included in most of the files, at the top of them. I didn't test if all compiles fine (only the daemon), but you get the idea. With this now you get: if g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wall -I../include -DINSTALL_PREFIX=\"/home/juam/src/licq/tree/\" -fPIC -DPIC -D_REENTRANT -g -O2 -fno-exceptions -fno-check-new -MT user.o -MD -MP -MF ".deps/user.Tpo" \ -c -o user.o `test -f 'user.cpp' || echo './'`user.cpp; \ then mv -f ".deps/user.Tpo" ".deps/user.Po"; \ else rm -f ".deps/user.Tpo"; exit 1; \ fi user.cpp: In member function `ICQOwner* CUserManager::FetchOwner(short unsigned int)': user.cpp:799: warning: `FetchOwner' is deprecated (declared at ../include/licq_user.h:802) the new macro LICQ_DEPRECATED can be also used in any variable. -- Buenos Aires, Argentina 10�C with winds at 3 km/h NW
Index: configure.in
===================================================================
RCS file: /cvsroot/licq/licq/configure.in,v
retrieving revision 1.63
diff -u -d -p -r1.63 configure.in
--- configure.in 2 Jul 2003 04:44:47 -0000 1.63
+++ configure.in 7 Jul 2003 05:41:12 -0000
@@ -172,6 +172,8 @@ AC_DISABLE_SHARED
AM_PROG_LIBTOOL
AC_LIBTOOL_CXX
+LICQ_DEPRECATED
+
AC_OUTPUT(
bin/Makefile \
share/Makefile \
Index: admin/acinclude.m4.in
===================================================================
RCS file: /cvsroot/licq/licq-common/admin/acinclude.m4.in,v
retrieving revision 1.20
diff -u -d -p -r1.20 acinclude.m4.in
--- admin/acinclude.m4.in 25 Jun 2003 15:45:51 -0000 1.20
+++ admin/acinclude.m4.in 7 Jul 2003 05:41:14 -0000
@@ -175,3 +175,29 @@ AC_DEFUN(AC_C_SOCKLEN_T_AND_SOCKS,
]);
])
+
+
+dnl Helper to remember what functions must be not used
+AC_DEFUN(LICQ_DEPRECATED,
+ [AH_BOTTOM([
+/* based on gpgme.h from gpgme cvs version (~ 0.4.2)
+ *
+ * Check for compiler features.
+ */
+#if __GNUC__
+ #ifndef _GPGME_GCC_VERSION
+ #define _GPGME_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+ #endif
+ #if _GPGME_GCC_VERSION > 30100
+ #ifndef LICQ_DEPRECATED
+ #define LICQ_DEPRECATED __attribute__ ((__deprecated__))
+ #endif
+ #endif
+#else
+ #define LICQ_DEPRECATED
+#endif
+])
+ ])
+])
Index: include/licq_user.h
===================================================================
RCS file: /cvsroot/licq/licq/include/licq_user.h,v
retrieving revision 1.44
diff -u -d -p -r1.44 licq_user.h
--- include/licq_user.h 2 Jul 2003 04:41:02 -0000 1.44
+++ include/licq_user.h 7 Jul 2003 05:41:38 -0000
@@ -250,8 +250,8 @@ const unsigned short LAST_CHECKED_AR
class ICQUser
{
public:
- ICQUser(unsigned long id, char *filename);
- ICQUser(unsigned long id);
+ ICQUser(unsigned long id, char *filename) LICQ_DEPRECATED;
+ ICQUser(unsigned long id) LICQ_DEPRECATED;
ICQUser(const char *id, unsigned long ppid, char *filename);
ICQUser(const char *id, unsigned long ppid);
virtual ~ICQUser();
@@ -799,7 +799,7 @@ public:
void AddUser(ICQUser *, const char *, unsigned long);
void RemoveUser(const char *, unsigned long);
ICQUser *FetchUser(const char *, unsigned long, unsigned short);
- ICQOwner *FetchOwner(unsigned long, unsigned short);
+ ICQOwner *FetchOwner(unsigned long, unsigned short) LICQ_DEPRECATED;
void DropOwner(unsigned long);
bool IsOnList(const char *, unsigned long);
ICQOwner *FindOwner(const char *, unsigned long);
Index: plugins/auto-reply/configure.in
===================================================================
RCS file: /cvsroot/licq/auto-reply/configure.in,v
retrieving revision 1.15
diff -u -d -p -r1.15 configure.in
--- plugins/auto-reply/configure.in 25 Jun 2003 16:08:19 -0000 1.15
+++ plugins/auto-reply/configure.in 7 Jul 2003 05:41:38 -0000
@@ -52,6 +52,8 @@ AC_CHECK_HEADER(vector.h,,
AC_LANG_RESTORE
+LICQ_DEPRECATED
+
AC_OUTPUT(
src/Makefile
Makefile)
Index: plugins/console/configure.in
===================================================================
RCS file: /cvsroot/licq/console/configure.in,v
retrieving revision 1.28
diff -u -d -p -r1.28 configure.in
--- plugins/console/configure.in 25 Jun 2003 16:08:19 -0000 1.28
+++ plugins/console/configure.in 7 Jul 2003 05:41:49 -0000
@@ -62,6 +62,8 @@ I can't find the ncurses library. This i
to compile this plugin. Sorry.
]))
+LICQ_DEPRECATED
+
AC_OUTPUT(
src/Makefile \
Makefile
Index: plugins/email/configure.in
===================================================================
RCS file: /cvsroot/licq/email/configure.in,v
retrieving revision 1.19
diff -u -d -p -r1.19 configure.in
--- plugins/email/configure.in 25 Jun 2003 16:08:19 -0000 1.19
+++ plugins/email/configure.in 7 Jul 2003 05:42:02 -0000
@@ -54,6 +54,8 @@ AC_CHECK_HEADER(vector.h,,
AC_LANG_RESTORE
+LICQ_DEPRECATED
+
AC_OUTPUT(
src/Makefile
Makefile)
Index: plugins/qt-gui/configure.in
===================================================================
RCS file: /cvsroot/licq/qt-gui/configure.in,v
retrieving revision 1.69
diff -u -d -p -r1.69 configure.in
--- plugins/qt-gui/configure.in 2 Jul 2003 04:44:47 -0000 1.69
+++ plugins/qt-gui/configure.in 7 Jul 2003 05:42:16 -0000
@@ -157,6 +157,8 @@ LICQ_CHECK_QT_HEADER
dnl Checks for typedefs, structures, and compiler characteristics.
dnl AC_C_SOCKLEN_T
+LICQ_DEPRECATED
+
AC_OUTPUT(
po/Makefile \
src/Makefile \
Index: plugins/rms/configure.in
===================================================================
RCS file: /cvsroot/licq/rms/configure.in,v
retrieving revision 1.8
diff -u -d -p -r1.8 configure.in
--- plugins/rms/configure.in 9 Sep 2002 23:19:01 -0000 1.8
+++ plugins/rms/configure.in 7 Jul 2003 05:42:29 -0000
@@ -49,6 +49,8 @@ dnl Switch to C++ mode and check for nee
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
+LICQ_DEPRECATED
+
AC_CHECK_HEADER(vector,,
AC_MSG_ERROR(You need to have the libstdc++ headers installed))
pgp00000.pgp
Description: signature
