Changeset: 060dd65a30bf for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/060dd65a30bf Modified Files: clients/Tests/exports.stable.out clients/mapilib/mapi.h clients/mapilib/msettings.h common/options/monet_getopt.h common/options/monet_options.h common/stream/stream.h common/utils/mcrypt.h common/utils/msabaoth.h common/utils/mutils.h gdk/gdk.h gdk/gdk_atoms.h gdk/gdk_cand.c gdk/gdk_cand.h gdk/gdk_group.c gdk/gdk_hash.c gdk/gdk_hash.h gdk/gdk_private.h gdk/gdk_string.c gdk/gdk_system.h geom/lib/libgeom.h geom/monetdb5/geom.h monetdb5/mal/mal.h monetdb5/mal/mal_namespace.c monetdb5/modules/mal/orderidx.h monetdb5/optimizer/opt_commonTerms.c monetdb_config.h.in sql/backends/monet5/UDF/pyapi3/pyheader.h sql/backends/monet5/UDF/udf/udf.h sql/backends/monet5/generator/generator.h sql/backends/monet5/sql.h sql/backends/monet5/sql_import.h sql/backends/monet5/vaults/fits/fits.h sql/backends/monet5/vaults/netcdf/netcdf_vault.h sql/backends/monet5/vaults/shp/shp.h sql/include/sql_mem.h tools/monetdbe/monetdbe.h Branch: default Log Message:
Updated the use of GCC attributes. diffs (truncated from 1212 to 300 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -20,7 +20,7 @@ BAT *BATasciify(BAT *b, BAT *s); void BATassertProps(BAT *b); atomDesc BATatoms[MAXATOMS]; BAT *BATattach(int tt, const char *heapfile, role_t role); -gdk_return BATbandjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, const void *c1, const void *c2, bool li, bool hi, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BATbandjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, const void *c1, const void *c2, bool li, bool hi, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); BAT *BATcalcabsolute(BAT *b, BAT *s); BAT *BATcalcadd(BAT *b1, BAT *b2, BAT *s1, BAT *s2, int tp); BAT *BATcalcaddcst(BAT *b, const ValRecord *v, BAT *s, int tp); @@ -122,11 +122,11 @@ BAT *BATdescriptor(bat i); BAT *BATdiff(BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool not_in, BUN estimate); BAT *BATdiffcand(BAT *a, BAT *b); gdk_return BATextend(BAT *b, BUN newcap) __attribute__((__warn_unused_result__)); -gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, BAT *grps, BUN n, bool asc, bool nilslast, bool distinct) __attribute__((__warn_unused_result__)); +gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, BAT *grps, BUN n, bool asc, bool nilslast, bool distinct) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); restrict_t BATgetaccess(BAT *b); ValPtr BATgetprop(BAT *b, enum prop_t idx); ValPtr BATgetprop_nolock(BAT *b, enum prop_t idx); -gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *s, BAT *g, BAT *e, BAT *h) __attribute__((__warn_unused_result__)); +gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *s, BAT *g, BAT *e, BAT *h) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__access__(write_only, 3))) __attribute__((__warn_unused_result__)); const char *BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s, oid *minp, oid *maxp, BUN *ngrpp, struct canditer *ci); gdk_return BATgroupavg(BAT **bnp, BAT **cntsp, BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, int scale); gdk_return BATgroupavg3(BAT **avgp, BAT **remp, BAT **cntp, BAT *b, BAT *g, BAT *e, BAT *s, bool skip_nils); @@ -155,10 +155,10 @@ bool BAThasstrimps(BAT *b); void BAThseqbase(BAT *b, oid o); BAT *BATintersect(BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool max_one, BUN estimate); BAT *BATintersectcand(BAT *a, BAT *b); -gdk_return BATjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BATjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); gdk_return BATkey(BAT *b, bool onoff); -gdk_return BATleftjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, BUN estimate) __attribute__((__warn_unused_result__)); -gdk_return BATmarkjoin(BAT **r1p, BAT **r2p, BAT **r3p, BAT *l, BAT *r, BAT *sl, BAT *sr, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BATleftjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); +gdk_return BATmarkjoin(BAT **r1p, BAT **r2p, BAT **r3p, BAT *l, BAT *r, BAT *sl, BAT *sr, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__access__(write_only, 3))) __attribute__((__warn_unused_result__)); BAT *BATmaskedcands(oid hseq, BUN nr, BAT *masked, bool selected); void *BATmax(BAT *b, void *aggr); void *BATmax_skipnil(BAT *b, void *aggr, bit skipnil); @@ -171,8 +171,8 @@ BAT *BATnil_grp(BAT *l, BAT *g, BAT *e, bool BATordered(BAT *b); bool BATordered_rev(BAT *b); gdk_return BATorderidx(BAT *b, bool stable); -gdk_return BAToutercross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool max_one) __attribute__((__warn_unused_result__)); -gdk_return BATouterjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool match_one, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BAToutercross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool max_one) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); +gdk_return BATouterjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool match_one, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); gdk_return BATprint(stream *s, BAT *b); gdk_return BATprintcolumns(stream *s, int argc, BAT *argv[]); gdk_return BATprod(void *res, int tp, BAT *b, BAT *s, bool skip_nils, bool nil_if_empty); @@ -188,7 +188,7 @@ BAT *BATsample(BAT *b, BUN n); BAT *BATsample_with_seed(BAT *b, BUN n, uint64_t seed); gdk_return BATsave(BAT *b) __attribute__((__warn_unused_result__)); BAT *BATselect(BAT *b, BAT *s, const void *tl, const void *th, bool li, bool hi, bool anti, bool nil_matches); -gdk_return BATsemijoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool max_one, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BATsemijoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool nil_matches, bool max_one, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); BAT *BATsetaccess(BAT *b, restrict_t mode) __attribute__((__warn_unused_result__)); void BATsetcapacity(BAT *b, BUN cnt); void BATsetcount(BAT *b, BUN cnt); @@ -196,14 +196,14 @@ ValPtr BATsetprop(BAT *b, enum prop_t id ValPtr BATsetprop_nolock(BAT *b, enum prop_t idx, int type, const void *v); gdk_return BATsetstrimps(BAT *b); BAT *BATslice(BAT *b, BUN low, BUN high); -gdk_return BATsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, BAT *o, BAT *g, bool reverse, bool nilslast, bool stable) __attribute__((__warn_unused_result__)); +gdk_return BATsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, BAT *o, BAT *g, bool reverse, bool nilslast, bool stable) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__access__(write_only, 3))) __attribute__((__warn_unused_result__)); gdk_return BATstr_group_concat(ValPtr res, BAT *b, BAT *s, BAT *sep, bool skip_nils, bool nil_if_empty, const char *restrict separator); -gdk_return BATsubcross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool max_one) __attribute__((__warn_unused_result__)); +gdk_return BATsubcross(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, bool max_one) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); BAT *BATsubexist(BAT *l, BAT *g, BAT *e, BAT *s); BAT *BATsubnot_exist(BAT *l, BAT *g, BAT *e, BAT *s); gdk_return BATsum(void *res, int tp, BAT *b, BAT *s, bool skip_nils, bool nil_if_empty); const char *BATtailname(const BAT *b); -gdk_return BATthetajoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int op, bool nil_matches, BUN estimate) __attribute__((__warn_unused_result__)); +gdk_return BATthetajoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, int op, bool nil_matches, BUN estimate) __attribute__((__access__(write_only, 1))) __attribute__((__access__(write_only, 2))) __attribute__((__warn_unused_result__)); BAT *BATthetaselect(BAT *b, BAT *s, const void *val, const char *op); BAT *BATtolower(BAT *b, BAT *s); BAT *BATtoupper(BAT *b, BAT *s); @@ -270,7 +270,7 @@ gdk_return GDKanalyticalsum(BAT *r, BAT gdk_return GDKanalyticalwindowbounds(BAT *r, BAT *b, BAT *p, BAT *l, const void *restrict bound, int tp1, int tp2, int unit, bool preceding, oid first_half); gdk_return GDKasciify(char **restrict buf, size_t *restrict buflen, const char *restrict s); int GDKatomcnt; -gdk_return GDKcasefold(char **restrict buf, size_t *restrict buflen, const char *restrict s); +gdk_return GDKcasefold(char **restrict buf, size_t *restrict buflen, const char *restrict s) __attribute__((__access__(read_write, 1))) __attribute__((__access__(read_write, 2))); void GDKclrerr(void); gdk_return GDKcopyenv(BAT **key, BAT **val, bool writable); gdk_return GDKcreatedir(const char *nme); @@ -326,8 +326,8 @@ char *GDKstrcasestr(const char *haystack str GDKstrdup(const char *s) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)); int GDKstrncasecmp(const char *str1, const char *str2, size_t l1, size_t l2); str GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)); -gdk_return GDKtolower(char **restrict buf, size_t *restrict buflen, const char *restrict s); -gdk_return GDKtoupper(char **restrict buf, size_t *restrict buflen, const char *restrict s); +gdk_return GDKtolower(char **restrict buf, size_t *restrict buflen, const char *restrict s) __attribute__((__access__(read_write, 1))) __attribute__((__access__(read_write, 2))); +gdk_return GDKtoupper(char **restrict buf, size_t *restrict buflen, const char *restrict s) __attribute__((__access__(read_write, 1))) __attribute__((__access__(read_write, 2))); gdk_return GDKtracer_fill_comp_info(BAT *id, BAT *component, BAT *log_level); gdk_return GDKtracer_flush_buffer(void); const char *GDKtracer_get_component_level(const char *comp); @@ -423,11 +423,11 @@ gdk_return TMsubcommit_list(bat *restric void VALclear(ValPtr v); int VALcmp(const ValRecord *p, const ValRecord *q); void *VALconvert(int typ, ValPtr t); -ValPtr VALcopy(ValPtr dst, const ValRecord *src); -void VALempty(ValPtr v); +ValPtr VALcopy(ValPtr dst, const ValRecord *src) __attribute__((__access__(write_only, 1))); +void VALempty(ValPtr v) __attribute__((__access__(write_only, 1))); char *VALformat(const ValRecord *res) __attribute__((__warn_unused_result__)); void *VALget(ValPtr v); -ValPtr VALinit(ValPtr d, int tpe, const void *s); +ValPtr VALinit(ValPtr d, int tpe, const void *s) __attribute__((__access__(write_only, 1))); bool VALisnil(const ValRecord *v); ValPtr VALset(ValPtr v, int t, void *p); gdk_return VARcalcabsolute(ValPtr ret, const ValRecord *v); @@ -474,11 +474,11 @@ ssize_t bteFromStr(const char *src, size ssize_t bteToStr(str *dst, size_t *len, const bte *src, bool external); const bte bte_nil; oid canditer_idx(const struct canditer *ci, BUN p) __attribute__((__pure__)); -void canditer_init(struct canditer *ci, BAT *b, BAT *s); +void canditer_init(struct canditer *ci, BAT *b, BAT *s) __attribute__((__access__(write_only, 1))); oid canditer_last(const struct canditer *ci) __attribute__((__pure__)); oid canditer_mask_next(const struct canditer *ci, oid o, bool next) __attribute__((__pure__)); -oid canditer_peek(struct canditer *ci) __attribute__((__pure__)); -oid canditer_peekprev(struct canditer *ci) __attribute__((__pure__)); +oid canditer_peek(const struct canditer *ci) __attribute__((__pure__)); +oid canditer_peekprev(const struct canditer *ci) __attribute__((__pure__)); oid canditer_prev(struct canditer *ci); void canditer_reset(struct canditer *ci); BUN canditer_search(const struct canditer *ci, oid o, bool next) __attribute__((__pure__)); @@ -527,7 +527,7 @@ char *dlerror(void); void *dlopen(const char *file, int mode); void *dlsym(void *handle, const char *name); _Noreturn void eb_error(exception_buffer *eb, char *msg, int val); -exception_buffer *eb_init(exception_buffer *eb); +exception_buffer *eb_init(exception_buffer *eb) __attribute__((__access__(write_only, 1))); size_t escapedStr(char *restrict dst, const char *restrict src, size_t dstlen, const char *sep1, const char *sep2, int quote); size_t escapedStrlen(const char *restrict src, const char *sep1, const char *sep2, int quote); ssize_t fltFromStr(const char *src, size_t *len, flt **dst, bool external); diff --git a/clients/mapilib/mapi.h b/clients/mapilib/mapi.h --- a/clients/mapilib/mapi.h +++ b/clients/mapilib/mapi.h @@ -66,7 +66,7 @@ extern "C" { #define mapi_export extern __declspec(dllexport) #endif #else -#define mapi_export extern +#define mapi_export __attribute__((__externally_visible__)) extern #endif #ifndef __GNUC__ diff --git a/clients/mapilib/msettings.h b/clients/mapilib/msettings.h --- a/clients/mapilib/msettings.h +++ b/clients/mapilib/msettings.h @@ -33,7 +33,7 @@ extern "C" { #define mapi_export extern __declspec(dllexport) #endif #else -#define mapi_export extern +#define mapi_export __attribute__((__externally_visible__)) extern #endif ///////////////////////////////////////////////////////////////////// diff --git a/common/options/monet_getopt.h b/common/options/monet_getopt.h --- a/common/options/monet_getopt.h +++ b/common/options/monet_getopt.h @@ -51,7 +51,7 @@ extern "C" { #endif #ifndef moptions_export -#define moptions_export extern +#define moptions_export __attribute__((__externally_visible__)) extern #endif /* For communication from `getopt' to the caller. diff --git a/common/options/monet_options.h b/common/options/monet_options.h --- a/common/options/monet_options.h +++ b/common/options/monet_options.h @@ -30,7 +30,7 @@ extern "C" { #endif #ifndef moptions_export -#define moptions_export extern +#define moptions_export __attribute__((__externally_visible__)) extern #endif /* mo_print_options will print the option set on stderr */ diff --git a/common/stream/stream.h b/common/stream/stream.h --- a/common/stream/stream.h +++ b/common/stream/stream.h @@ -46,7 +46,7 @@ # define stream_export extern __declspec(dllexport) # endif #else -# define stream_export extern +# define stream_export __attribute__((__externally_visible__)) extern #endif /* Defines to help the compiler check printf-style format arguments. diff --git a/common/utils/mcrypt.h b/common/utils/mcrypt.h --- a/common/utils/mcrypt.h +++ b/common/utils/mcrypt.h @@ -20,7 +20,7 @@ #define mcrypt_export extern __declspec(dllexport) #endif #else -#define mcrypt_export extern +#define mcrypt_export __attribute__((__externally_visible__)) extern #endif mcrypt_export const char *mcrypt_getHashAlgorithms(void) diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h --- a/common/utils/msabaoth.h +++ b/common/utils/msabaoth.h @@ -66,7 +66,7 @@ typedef struct Ssabuplog { #define msab_export extern __declspec(dllexport) #endif #else -#define msab_export extern +#define msab_export __attribute__((__externally_visible__)) extern #endif msab_export void msab_dbpathinit(const char *dbpath); diff --git a/common/utils/mutils.h b/common/utils/mutils.h --- a/common/utils/mutils.h +++ b/common/utils/mutils.h @@ -20,7 +20,7 @@ #define mutils_export extern __declspec(dllexport) #endif #else -#define mutils_export extern +#define mutils_export __attribute__((__externally_visible__)) extern #endif #ifdef NATIVE_WIN32 diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -342,7 +342,7 @@ #define gdk_export extern __declspec(dllexport) #endif #else -#define gdk_export extern +#define gdk_export __attribute__((__externally_visible__)) extern #endif /* Only ever compare with GDK_SUCCEED, never with GDK_FAIL, and do not @@ -653,9 +653,12 @@ typedef struct { gdk_export void *VALconvert(int typ, ValPtr t); gdk_export char *VALformat(const ValRecord *res) __attribute__((__warn_unused_result__)); -gdk_export ValPtr VALcopy(ValPtr dst, const ValRecord *src); -gdk_export ValPtr VALinit(ValPtr d, int tpe, const void *s); -gdk_export void VALempty(ValPtr v); +gdk_export ValPtr VALcopy(ValPtr dst, const ValRecord *src) + __attribute__((__access__(write_only, 1))); +gdk_export ValPtr VALinit(ValPtr d, int tpe, const void *s) + __attribute__((__access__(write_only, 1))); +gdk_export void VALempty(ValPtr v) + __attribute__((__access__(write_only, 1))); gdk_export void VALclear(ValPtr v); gdk_export ValPtr VALset(ValPtr v, int t, void *p); gdk_export void *VALget(ValPtr v); @@ -1446,6 +1449,9 @@ gdk_export gdk_return BATclear(BAT *b, b gdk_export BAT *COLcopy(BAT *b, int tt, bool writable, role_t role); gdk_export gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *s, BAT *g, BAT *e, BAT *h) + __attribute__((__access__(write_only, 1))) + __attribute__((__access__(write_only, 2))) + __attribute__((__access__(write_only, 3))) __attribute__((__warn_unused_result__)); /* * @- BAT Input/Output @@ -1525,6 +1531,9 @@ gdk_export gdk_return BATprint(stream *s gdk_export bool BATordered(BAT *b); gdk_export bool BATordered_rev(BAT *b); gdk_export gdk_return BATsort(BAT **sorted, BAT **order, BAT **groups, BAT *b, BAT *o, BAT *g, bool reverse, bool nilslast, bool stable) + __attribute__((__access__(write_only, 1))) + __attribute__((__access__(write_only, 2))) + __attribute__((__access__(write_only, 3))) __attribute__((__warn_unused_result__)); @@ -1731,7 +1740,8 @@ gdk_export void GDKclrerr(void); * allocated in the theap (tvheap for variable-sized types is still * extended if needed, making that these functions can fail). */ -static inline gdk_return __attribute__((__warn_unused_result__)) +__attribute__((__warn_unused_result__)) +static inline gdk_return tfastins_nocheckVAR(BAT *b, BUN p, const void *v) { var_t d; @@ -1771,13 +1781,15 @@ tfastins_nocheckVAR(BAT *b, BUN p, const return GDK_SUCCEED; } -static inline gdk_return __attribute__((__warn_unused_result__)) +__attribute__((__warn_unused_result__)) +static inline gdk_return tfastins_nocheckFIX(BAT *b, BUN p, const void *v) { _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org