I wonder if anyone can shed some light on this. I got a header file with several always_inline methods, which is included in several places. Since I upgraded the OS (Debian Wheezy) with the newer version of gcc 4.7.1, I get the load of line break warnings. I can compile this successfully on gcc 4.4.5 (Debian Squeezy). The compilation command I'm using is
gcc -g -Wall -O0 -o [prog_name] [sources].c -l[link libraries]
code:
#ifndef __MCIDSHEADER_H__ #define __MCIDSHEADER_H__ #include <stdlib.h> /* C functions */ #ifdef __cplusplus extern "C" { #endif /* Constructor and destructor */ mcidsheader* mcidsheader_new(mcidsheader* obj, sqlite3* ids, crSettings* settings); void mcidsheader_delete(mcidsheader* obj); /* set schedule number */ __attribute__ ((always_inline)) static int mcidsheader_set_schedno(mcidsheader* obj, unsigned int var) { MC_CHK_OBJ(obj); obj->var_sched_no = var; /* memset schedule number */ memset(obj->var_sched, 0, MCIDSHEADER_SCHEDNUM_SZ); /* copy to local */ sprintf(obj->var_sched, "%i", var); obj->var_flg = 0; return 0; } /* Get schedule number */ __attribute__ ((always_inline)) static const char* mcidsheader_get_schedno(const mcidsheader* obj) { MC_CHK_OBJ_PTR(obj); return obj->var_sched; } /* set job number */ __attribute__ ((always_inline)) static int mcidsheader_set_jobnumber(mcidsheader* obj, const char* var) { MC_CHK_OBJ(obj); /* memset buff */ memset(obj->var_jobnumber, 0, MCIDSHEADER_JOBNUMBER_SZ); MC_CHK_OBJ(var); /* copy to local */ strcpy(obj->var_jobnumber, var); obj->var_flg = 0; return 0; } /* get job number */ __attribute__ ((always_inline)) static const char* mcidsheader_get_jobnumber(const mcidsheader* obj) { MC_CHK_OBJ_PTR(obj); return obj->var_jobnumber; } /* set project */ __attribute__ ((always_inline)) static int mcidsheader_set_project(mcidsheader* obj, const char* var) { MC_CHK_OBJ(obj); /* memset buff */ memset(obj->var_project, 0, MCIDSHEADER_PROJECT_SZ); MC_CHK_OBJ(var); /* copy to local */ strcpy(obj->var_project, var); obj->var_flg = 0; return 0; } /* Get project name */ __attribute__ ((always_inline)) static const char* mcidsheader_get_project(const mcidsheader* obj) { MC_CHK_OBJ_PTR(obj); return obj->var_project; } /* Set client */ __attribute__ ((always_inline)) static int mcidsheader_set_client(mcidsheader* obj, const char* var) { MC_CHK_OBJ(obj); /* memset buff */ memset(obj->var_client, 0, MCIDSHEADER_CLIENT_SZ); MC_CHK_OBJ(var); /* copy to local */ strcpy(obj->var_client, var); obj->var_flg = 0; return 0; } /* get client */ __attribute__ ((always_inline)) static const char* mcidsheader_get_client(const mcidsheader* obj) { MC_CHK_OBJ(obj); return obj->var_client; } /* set date */ __attribute__ ((always_inline)) static int mcidsheader_set_date(mcidsheader* obj, const char* var) { MC_CHK_OBJ(obj); /* memset buff */ memset(obj->var_date, 0, MCIDSHEADER_DATE_SZ); MC_CHK_OBJ(var); /* copy to local */ strcpy(obj->var_date, var); obj->var_flg = 0; return 0; } /* get date */ __attribute__ ((always_inline)) static const char* mcidsheader_get_date(const mcidsheader* obj) { MC_CHK_OBJ_PTR(obj); return obj->var_date; } /* Get struct size */ __attribute__ ((always_inline)) static unsigned int mcidsheader_get_size(const mcidsheader* obj) { if(!obj) return 0; return obj->var_size; } #ifdef __cplusplus } #endif #endif /* __MCIDSHEADER_H__ */
source share