[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Positioning GCC_ATTR_DEPRECATED
From: |
Rik |
Subject: |
Positioning GCC_ATTR_DEPRECATED |
Date: |
Sat, 26 Dec 2015 20:20:09 -0800 |
12/26/15
jwe,
We are making use of GCC's attribute mechanism in various forms. Normally
the attribute is just a small hint to the compiler and its position in the
declaration (at the very end) reflects its low importance. However, for
deprecated functions the fact that the attribute could be at the far end of
a multi-line declaration can make it easy to miss. Why not move the
attribute to the front of the function so as a programmer is skimming the
list of member functions to a class it is quite clear that this function
should not be used?
I would not have necessarily thought of this, but for the fact that this is
already being done in ov.h. For example,
GCC_ATTR_DEPRECATED octave_idx_type capacity (void) const
versus
octave_value (const charMatrix& chm, bool is_string,
char type = '\'') GCC_ATTR_DEPRECATED;
--Rik
- Positioning GCC_ATTR_DEPRECATED,
Rik <=