Skip to contentSkip to conversation

: Fix some gcc 4.0 compile failures and warnings

PATCH Applied Mickey Stein 3 participants 4 messages Feb 23, 2005 – Feb 25, 2005

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix some gcc 4.0 compile failures and warnings

From: Mickey Stein
Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc rawhide from 19Feb DL)

gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due to a current gcc 4.0.x change having to do with array declarations.

Example error msg: include/linux/i2c.h:{55,194} error: array type has incomplete element type

A. Daplas has recently done a workaround for this on another header file. A thread discussing this can be found by following the link below:

http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html

The patch changes the array(struct i2c_msg) declaration used by *i2c_transfer and *master_xfer from "struct i2c_msg msg[]" format to "struct i2c_msg *msg".

After some grepping, I came up with about a dozen files that used the format disliked by gcc4 that're addressed by the attached patch. Tested on gcc 3.x & gcc 4.x by configuring kernel with all i2c switches enabled as module, and saw no errors or warnings in i2c.

include/linux/i2c.h renamed from include/linux/i2c.h.sav +2 -2
@@ -55,7 +55,7 @@
 
 /* Transfer num messages.
  */
-extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
+extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
 
 /*
  * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. 
@@ -194,7 +194,7 @@
 	   to NULL. If an adapter algorithm can do SMBus access, set 
 	   smbus_xfer. If set to NULL, the SMBus protocol is simulated
 	   using common I2C messages */
-	int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], 
+	int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 
 	                   int num);
 	int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 
 	                   unsigned short flags, char read_write,
drivers/i2c/busses/i2c-iop3xx.c renamed from drivers/i2c/busses/i2c-iop3xx.c.sav +1 -1
@@ -361,7 +361,7 @@
  * master_xfer() - main read/write entry
  */
 static int 
-iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], 
+iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, 
 				int num)
 {
 	struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
drivers/i2c/i2c-core.c renamed from drivers/i2c/i2c-core.c.sav +1 -1
@@ -583,7 +583,7 @@
  * ----------------------------------------------------
  */
 
-int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg msgs[],int num)
+int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num)
 {
 	int ret;
 
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c renamed from drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c.sav +1 -1
@@ -252,7 +252,7 @@
 	return rcv_len;
 }
 
-static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num)
+static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num)
 {
 	struct ttusb *ttusb = i2c_get_adapdata(adapter);
 	int i = 0;
drivers/media/dvb/b2c2/skystar2.c renamed from drivers/media/dvb/b2c2/skystar2.c.sav +1 -1
@@ -293,7 +293,7 @@
 	return buf - start;
 }
 
-static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg msgs[], int num)
+static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msgs, int num)
 {
 	struct adapter *tmp = i2c_get_adapdata(adapter);
 	int i, ret = 0;
Documentation/i2c/writing-clients renamed from Documentation/i2c/writing-clients.sav +1 -1
@@ -642,7 +642,7 @@
 parameter contains the bytes the read/write, the third the length of the
 buffer. Returned is the actual number of bytes read/written.
   
-  extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
+  extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg,
                           int num);
 
 This sends a series of messages. Each message can be a read or write,
include/media/saa7146.h renamed from include/media/saa7146.h.sav +1 -1
@@ -157,7 +157,7 @@
 
 /* from saa7146_i2c.c */
 int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate);
-int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct i2c_msg msgs[], int num,  int retries);
+int saa7146_i2c_transfer(struct saa7146_dev *saa, const struct *i2c_msg msgs, int num,  int retries);
 
 /* from saa7146_core.c */
 extern struct list_head saa7146_devices;
drivers/i2c/busses/i2c-s3c2410.c renamed from drivers/i2c/busses/i2c-s3c2410.c.sav +2 -2
@@ -483,7 +483,7 @@
  * this starts an i2c transfer
 */
 
-static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg msgs[], int num)
+static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num)
 {
 	unsigned long timeout;
 	int ret;
@@ -534,7 +534,7 @@
 */
 
 static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
-			struct i2c_msg msgs[], int num)
+			struct i2c_msg *msgs, int num)
 {
 	struct s3c24xx_i2c *i2c = (struct s3c24xx_i2c *)adap->algo_data;
 	int retry;
drivers/i2c/busses/i2c-mpc.c renamed from drivers/i2c/busses/i2c-mpc.c.sav +1 -1
@@ -233,7 +233,7 @@
 	return length;
 }
 
-static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
+static int mpc_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 {
 	struct i2c_msg *pmsg;
 	int i;
drivers/i2c/busses/i2c-ibm_iic.c renamed from drivers/i2c/busses/i2c-ibm_iic.c.sav +1 -1
@@ -549,7 +549,7 @@
  * Generic master transfer entrypoint. 
  * Returns the number of processed messages or error (<0)
  */
-static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
+static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 {
     	struct ibm_iic_private* dev = (struct ibm_iic_private*)(i2c_get_adapdata(adap));
 	volatile struct iic_regs __iomem *iic = dev->vaddr;
drivers/i2c/busses/i2c-keywest.c renamed from drivers/i2c/busses/i2c-keywest.c.sav +1 -1
@@ -399,7 +399,7 @@
  */
 static int
 keywest_xfer(	struct i2c_adapter *adap,
-		struct i2c_msg msgs[], 
+		struct i2c_msg *msgs, 
 		int num)
 {
 	struct keywest_chan* chan = i2c_get_adapdata(adap);
drivers/i2c/busses/i2c-au1550.c renamed from drivers/i2c/busses/i2c-au1550.c.sav +1 -1
@@ -253,7 +253,7 @@
 }
 
 static int
-au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
+au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
 {
 	struct i2c_au1550_data *adap = i2c_adap->algo_data;
 	struct i2c_msg *p;
drivers/i2c/algos/i2c-algo-pca.c renamed from drivers/i2c/algos/i2c-algo-pca.c.sav +1 -1
@@ -178,7 +178,7 @@
 }
 
 static int pca_xfer(struct i2c_adapter *i2c_adap,
-                    struct i2c_msg msgs[],
+                    struct i2c_msg *msgs,
                     int num)
 {
         struct i2c_algo_pca_data *adap = i2c_adap->algo_data;
drivers/i2c/algos/i2c-algo-pcf.c renamed from drivers/i2c/algos/i2c-algo-pcf.c.sav +1 -1
@@ -332,7 +332,7 @@
 }
 
 static int pcf_xfer(struct i2c_adapter *i2c_adap,
-		    struct i2c_msg msgs[], 
+		    struct i2c_msg *msgs, 
 		    int num)
 {
 	struct i2c_algo_pcf_data *adap = i2c_adap->algo_data;
drivers/i2c/algos/i2c-algo-ite.c renamed from drivers/i2c/algos/i2c-algo-ite.c.sav +2 -2
@@ -490,7 +490,7 @@
  * condition.
  */
 #if 0
-static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num) 
+static int iic_combined_transaction(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) 
 {
    int i;
    struct i2c_msg *pmsg;
@@ -600,7 +600,7 @@
  * verify that the bus is not busy or in some unknown state.
  */
 static int iic_xfer(struct i2c_adapter *i2c_adap,
-		    struct i2c_msg msgs[], 
+		    struct i2c_msg *msgs, 
 		    int num)
 {
 	struct i2c_algo_iic_data *adap = i2c_adap->algo_data;
drivers/i2c/algos/i2c-algo-sgi.c renamed from drivers/i2c/algos/i2c-algo-sgi.c.sav +1 -1
@@ -131,7 +131,7 @@
 	return 0;
 }
 
-static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[],
+static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
 		    int num)
 {
 	struct i2c_algo_sgi_data *adap = i2c_adap->algo_data;
drivers/media/video/saa7134/saa7134-i2c.c renamed from drivers/media/video/saa7134/saa7134-i2c.c.sav +1 -1
@@ -236,7 +236,7 @@
 }
 
 static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
-			    struct i2c_msg msgs[], int num)
+			    struct i2c_msg *msgs, int num)
 {
 	struct saa7134_dev *dev = i2c_adap->algo_data;
 	enum i2c_status status;
drivers/media/video/bttv-i2c.c renamed from drivers/media/video/bttv-i2c.c.sav +1 -1
@@ -245,7 +245,7 @@
        	return retval;
 }
 
-static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
+static int bttv_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
 {
 	struct bttv *btv = i2c_get_adapdata(i2c_adap);
 	int retval = 0;
drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c renamed from drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c.sav +1 -1
@@ -38,7 +38,7 @@
 /*
  * I2C master xfer function
  */
-static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num)
+static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg *msg,int num)
 {
 	struct usb_dibusb *dib = i2c_get_adapdata(adap);
 	int i;
drivers/media/common/saa7146_i2c.c renamed from drivers/media/common/saa7146_i2c.c.sav +4 -4
@@ -25,7 +25,7 @@
    sent through the saa7146. have a look at the specifications p. 122 ff 
    to understand this. it returns the number of u32s to send, or -1
    in case of an error. */
-static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op)
+static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, u32 *op)
 {
 	int h1, h2;
 	int i, j, addr;
@@ -89,7 +89,7 @@
    which bytes were read through the adapter and write them back to the corresponding
    i2c-message. but instead, we simply write back all bytes.
    fixme: this could be improved. */
-static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op)
+static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, u32 *op)
 {
 	int i, j;
 	int op_count = 0;
@@ -272,7 +272,7 @@
 	return 0;
 }
 
-int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], int num, int retries)
+int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries)
 {
 	int i = 0, count = 0;
 	u32* buffer = dev->d_i2c.cpu_addr;
@@ -372,7 +372,7 @@
 }
 
 /* utility functions */
-static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num)
+static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num)
 {
 	struct saa7146_dev* dev = i2c_get_adapdata(adapter);
 	
#1 lore raw
Quoted 6 lines · Mickey Stein

From: Mickey Stein
Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc rawhide from 19Feb DL)

gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due to a current gcc 4.0.x change having to do with array declarations.

Quoted 7 lines

Example error msg: include/linux/i2c.h:{55,194} error: array type has incomplete element type

A. Daplas has recently done a workaround for this on another header file. A thread discussing this can be found by following the link below:

http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html

Do you know if the new compiler will compile....

int main(int argc, char *argv[]){}

?????

... or would one have to change every F* file in the world to be:

int main(int argc, char **argv){};

... which is wrong because it's truly a pointer to an array of strings.

If so, the compiler is broken. Also, in the cited link, if anybody at GNU bothered to read the Response from the Committee on the cited defect report, they said; "No constraint are violated, therefore no diagnostics are required"......

We shouldn't "fix" the kernel for broken compilers.

I attached a grep of GNU's own C-header files. I guess they expect us to change all those too, no?

aio.h:extern int aio_suspend (__const struct aiocb *__const __list[], int __nent,
aio.h: (__const struct aiocb *__const __list[],
aio.h:extern int aio_suspend64 (__const struct aiocb64 *__const __list[], int __nent, argz.h:extern error_t __argz_create (char *__const __argv[], char **__restrict __argz, argz.h:extern error_t argz_create (char *__const __argv[], char **__restrict __argz, audiofile.h:void afInitLoopIDs (AFfilesetup, int instid, int ids[], int nids); audiofile.h:int afGetLoopIDs (AFfilehandle, int instid, int loopids[]); audiofile.h:int afGetMarkIDs (AFfilehandle file, int trackid, int markids[]); baudboy.h:static inline int _doit(const char * argv[])

baudboy.h:    const char * argv[] = { LOCKDEV_PATH, "-l", NULL, NULL};
baudboy.h:    const char * argv[] = { LOCKDEV_PATH, "-u", NULL, NULL};
baudboy.h:    const char * argv[] = { LOCKDEV_PATH, NULL, NULL};

colorname.h:pm_parse_dictionary_name(const char colorname[], long const lmaxval, curses.h:extern NCURSES_EXPORT_VAR(chtype) acs_map[];
curses.h:extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
db_cxx.h: DB_LOCKREQ list[], int nlist, DB_LOCKREQ **elistp);
db_cxx.h: virtual int log_archive(char **list[], u_int32_t flags);
db.h: int (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
dejagnu.h:const char *outstate_list[] = {
expect.h:EXTERN int exp_spawnv _ANSI_ARGS_((char *file, char *argv[]));
fam.h:extern char *FamErrlist[];
ghttp_constants.h:extern const char http_hdr_Allow[]; ghttp_constants.h:extern const char http_hdr_Content_Encoding[]; ghttp_constants.h:extern const char http_hdr_Content_Language[]; ghttp_constants.h:extern const char http_hdr_Content_Length[]; ghttp_constants.h:extern const char http_hdr_Content_Location[]; ghttp_constants.h:extern const char http_hdr_Content_MD5[]; ghttp_constants.h:extern const char http_hdr_Content_Range[]; ghttp_constants.h:extern const char http_hdr_Content_Type[]; ghttp_constants.h:extern const char http_hdr_Expires[]; ghttp_constants.h:extern const char http_hdr_Last_Modified[]; ghttp_constants.h:extern const char http_hdr_Cache_Control[]; ghttp_constants.h:extern const char http_hdr_Connection[]; ghttp_constants.h:extern const char http_hdr_Date[]; ghttp_constants.h:extern const char http_hdr_Pragma[]; ghttp_constants.h:extern const char http_hdr_Transfer_Encoding[]; ghttp_constants.h:extern const char http_hdr_Update[]; ghttp_constants.h:extern const char http_hdr_Trailer[]; ghttp_constants.h:extern const char http_hdr_Via[]; ghttp_constants.h:extern const char http_hdr_Accept[]; ghttp_constants.h:extern const char http_hdr_Accept_Charset[]; ghttp_constants.h:extern const char http_hdr_Accept_Encoding[]; ghttp_constants.h:extern const char http_hdr_Accept_Language[]; ghttp_constants.h:extern const char http_hdr_Authorization[]; ghttp_constants.h:extern const char http_hdr_Expect[]; ghttp_constants.h:extern const char http_hdr_From[]; ghttp_constants.h:extern const char http_hdr_Host[]; ghttp_constants.h:extern const char http_hdr_If_Modified_Since[]; ghttp_constants.h:extern const char http_hdr_If_Match[]; ghttp_constants.h:extern const char http_hdr_If_None_Match[]; ghttp_constants.h:extern const char http_hdr_If_Range[]; ghttp_constants.h:extern const char http_hdr_If_Unmodified_Since[]; ghttp_constants.h:extern const char http_hdr_Max_Forwards[]; ghttp_constants.h:extern const char http_hdr_Proxy_Authorization[]; ghttp_constants.h:extern const char http_hdr_Range[]; ghttp_constants.h:extern const char http_hdr_Referrer[]; ghttp_constants.h:extern const char http_hdr_TE[]; ghttp_constants.h:extern const char http_hdr_User_Agent[]; ghttp_constants.h:extern const char http_hdr_Accept_Ranges[]; ghttp_constants.h:extern const char http_hdr_Age[]; ghttp_constants.h:extern const char http_hdr_ETag[]; ghttp_constants.h:extern const char http_hdr_Location[]; ghttp_constants.h:extern const char http_hdr_Retry_After[]; ghttp_constants.h:extern const char http_hdr_Server[]; ghttp_constants.h:extern const char http_hdr_Vary[]; ghttp_constants.h:extern const char http_hdr_Warning[]; ghttp_constants.h:extern const char http_hdr_WWW_Authenticate[]; ghttp_constants.h:extern const char http_hdr_Set_Cookie[]; ghttp_constants.h:extern const char http_hdr_DAV[]; ghttp_constants.h:extern const char http_hdr_Depth[]; ghttp_constants.h:extern const char http_hdr_Destination[]; ghttp_constants.h:extern const char http_hdr_If[]; ghttp_constants.h:extern const char http_hdr_Lock_Token[]; ghttp_constants.h:extern const char http_hdr_Overwrite[]; ghttp_constants.h:extern const char http_hdr_Status_URI[]; ghttp_constants.h:extern const char http_hdr_Timeout[];
gif_lib.h: GifPixelType ColorTransIn2[]);
gif_lib.h:extern void ApplyTranslation(SavedImage *Image, GifPixelType Translation[]); gif_lib.h:extern int AddExtensionBlock(SavedImage *New, int Len, char ExtData[]); gif_lib.h:extern unsigned char AsciiTable[][GIF_FONT_WIDTH];
gpm.h:extern unsigned char _gpm_buf[];
hfs.h:extern const unsigned char hfs_charorder[];
hfs.h: const char *, unsigned int, const unsigned long []);
iwlib.h: char * args[],
iwlib.h: char * args[],
iwlib.h:extern const char * const iw_operation_mode[];

jpeglib.h:  int component_index;		/* its index in SOF or cinfo->comp_info[] */
jpeglib.h:  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
jpeglib.h:  unsigned int data_length;	/* # bytes of data saved at data[] */
k3bdevice.h:    static const char* cdrdao_drivers[];

krb5.h: krb5_prompt prompts[]);
krb5.h: krb5_prompt prompts[]);
libaio.h:extern int io_submit(io_context_t ctx, long nr, struct iocb *ios[]); libesmtp.h:char *smtp_strerror (int error, char buf[], size_t buflen); link.h:extern ElfW(Dyn) _DYNAMIC[];
ltdl.h: extern const lt_dlsymlist lt_preloaded_symbols[]; \
mpi.h:extern int MPI_Group_range_excl __ARGS((MPI_Group, int, int [][3], mpi.h:extern int MPI_Group_range_incl __ARGS((MPI_Group, int, int [][3], mpi.h:extern int PMPI_Group_range_excl __ARGS((MPI_Group, int, int [][3], mpi.h:extern int PMPI_Group_range_incl __ARGS((MPI_Group, int, int [][3], ncurses.h:extern NCURSES_EXPORT_VAR(chtype) acs_map[];
ncurses.h:extern NCURSES_EXPORT_VAR(char) ttytype[]; /* needed for backward compatibility */
netdb.h:extern int gai_suspend (__const struct gaicb *__const __list[], int __ent, pbmfont.h:int mk_argvn ARGS(( char* s, char* vec[], int max )); pbm.h:void pbm_init ARGS(( int* argcP, char* argv[] ));
pgm.h:void pgm_init ARGS(( int* argcP, char* argv[] ));
pgtypes_numeric.h: int ndigits; /* number of digits in digits[] - can be
pgtypes_numeric.h: NumericDigit *buf; /* start of alloc'd space for digits[] */
pgtypes_numeric.h: int ndigits; /* number of digits in digits[] - can be
pi-datebook.h: extern char *DatebookAlarmTypeNames[];
pi-datebook.h: extern char *DatebookRepeatTypeNames[];
pi-datebook.hxx: delete [] _description;
pi-datebook.hxx: delete [] _note;
pi-dlp.h: extern char *dlp_errorlist[];
pi-expense.h: extern char *ExpenseSortNames[];
pi-expense.h: extern char *ExpenseDistanceNames[];
pi-expense.h: extern char *ExpensePaymentNames[];
pi-expense.h: extern char *ExpenseTypeNames[];
pi-mail.h: extern char *MailSyncTypeNames[];
pi-mail.h: extern char *MailSortTypeNames[];
pm.h:pm_proginit(int* const argcP, char* argv[]);
pm.h:pm_message (const char format[], ...);
pm.h:pm_error (const char reason[], ...);
pm.h:pm_perror (const char reason[]);
pm.h:pm_usage (const char usage[]);
pm.h:pm_openr_seekable(const char name[]); pm.h:pm_arg0toprogname(const char arg0[]);
pnm.h:void pnm_init ARGS(( int* argcP, char* argv[] ));
popt.h:extern struct poptOption poptAliasOptions[];
popt.h:extern struct poptOption poptHelpOptions[];
ppm.h:void ppm_init ARGS(( int* argcP, char* argv[] )); recodext.h:extern const recode_ucs2 ucs2_data_pool[];
resolv.h: unsigned nsort:4; /* number of elements in sort_list[] */
shhopt.h:void optParseOptions(int *argc, char *argv[],
shhopt.h: optStruct opt[], int allowNegNum);
shhopt.h:optParseOptions2(int * const argc_p, char *argv[], const optStruct2 opt, shhopt.h:optParseOptions3(int * const argc_p, char *argv[], const optStruct3 opt,
spawn.h: char *__const argv[], char *__const envp[]);
stdlib.h:extern int getloadavg (double __loadavg[], int __nelem) __THROW; tcldbg.h:EXTERN char **Dbg_ArgcArgv _ANSI_ARGS_((int argc,char *argv[],
tclDecls.h: Tcl_Obj *CONST objv[]));
tclDecls.h: int objc, Tcl_Obj *CONST objv[]));
tclDecls.h: Tcl_Obj *CONST objv[]));
tclDecls.h: int objc, Tcl_Obj *CONST objv[]));
tclDecls.h: Tcl_Obj *CONST objv[]));
tclDecls.h: int objc, Tcl_Obj *CONST objv[],
tclDecls.h: int objc, Tcl_Obj *CONST objv[], int flags));
tclDecls.h: Tcl_Obj *CONST objv[]));
tclDecls.h: int objc, Tcl_Obj *CONST objv[]));

tclDecls.h:    Tcl_Obj * (*tcl_ConcatObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 17 */
tclDecls.h:    int (*tcl_ListObjReplace) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * listPtr, int first, int count, int objc, Tcl_Obj *CONST objv[])); /* 48 */
tclDecls.h:    Tcl_Obj * (*tcl_NewListObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 53 */
tclDecls.h:    void (*tcl_SetListObj) _ANSI_ARGS_((Tcl_Obj * objPtr, int objc, Tcl_Obj *CONST objv[])); /* 62 */
tclDecls.h:    int (*tcl_CreateAliasObj) _ANSI_ARGS_((Tcl_Interp * slave, CONST char * slaveCmd, Tcl_Interp * target, CONST char * targetCmd, int objc, Tcl_Obj *CONST objv[])); /* 87 */
tclDecls.h:    void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], CONST char * message)); /* 264 */
tclDecls.h:    int (*tcl_EvalObjv) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], int flags)); /* 292 */
tclDecls.h:    int (*tcl_ProcObjCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 390 */
tclDecls.h:    Tcl_Obj* (*tcl_FSJoinToPath) _ANSI_ARGS_((Tcl_Obj * basePtr, int objc, Tcl_Obj *CONST objv[])); /* 464 */

tcl.h: Tcl_Interp *interp, int argc, CONST84 char *argv[]));
tcl.h: ClientData cmdClientData, int argc, CONST84 char *argv[]));
tcpd.h:extern char unknown[];
tcpd.h:extern char paranoid[];
term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[]; term.h:extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; term.h:extern NCURSES_EXPORT_VAR(char) ttytype[];
tkDecls.h: int objc, Tcl_Obj *CONST objv[],
tkDecls.h: int objc, Tcl_Obj *CONST objv[],

tkDecls.h:    int (*tk_GetScrollInfoObj) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], double * dblPtr, int * intPtr)); /* 210 */
tkDecls.h:    int (*tk_SetOptions) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *CONST objv[], Tk_Window tkwin, Tk_SavedOptions * savePtr, int * maskPtr)); /* 214 */
tk.h:		XPoint xPoints[], double dblPoints[]));
tk.h:		    Tcl_Obj *CONST objv[]));
tk.h:		    Tcl_Obj *CONST objv[], int flags));
tk.h:		    Tcl_Obj *CONST argv[]));

tk.h: char *name, int objc, Tcl_Obj *CONST objv[], Tk_ImageType *typePtr,
unistd.h:extern int execve (__const char *__path, char *__const __argv[],
unistd.h: char *__const __envp[]) __THROW;
unistd.h:extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) unistd.h:extern int execv (__const char *__path, char *__const __argv[]) __THROW; unistd.h:extern int execvp (__const char *__file, char *__const __argv[]) __THROW; unistd.h:extern int getgroups (int __size, __gid_t __list[]) __THROW;

#2 lore raw
Quoted 17 lines · linux-os
Quoted 15 lines · Mickey Stein

From: Mickey Stein
Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc
rawhide from 19Feb DL)

gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due to a current gcc 4.0.x change having to do with
array declarations.

Example error msg: include/linux/i2c.h:{55,194} error: array type has
incomplete element type

A. Daplas has recently done a workaround for this on another header file. A thread discussing this
can be found by following the link below:

Quoted 8 lines
Quoted 2 lines

http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html

Do you know if the new compiler will compile....

int main(int argc, char *argv[]){}

?????

That's not the point here. See the above thread for the real point.

greg k-h

Applied
#3 lore raw
In reply to Mickey Stein
Quoted 21 lines · Mickey Stein

From: Mickey Stein
Versions: linux-2.6.11-rc4-bk11, gcc4 (GCC) 4.0.0 20050217 (latest fc
rawhide from 19Feb DL)

gcc 4.0.x cvs seems to dislike "include/linux/i2c.h file" and others due to a current gcc 4.0.x change having to do with
array declarations.

Example error msg: include/linux/i2c.h:{55,194} error: array type has
incomplete element type

A. Daplas has recently done a workaround for this on another header file. A thread discussing this
can be found by following the link below:

http://gcc.gnu.org/ml/gcc/2005-02/msg00053.html

The patch changes the array(struct i2c_msg) declaration used by *i2c_transfer and *master_xfer
from "struct i2c_msg msg[]" format to "struct i2c_msg *msg".

Quoted 6 lines

After some grepping, I came up with about a dozen files that used the format disliked by gcc4 that're addressed by the attached patch. Tested on gcc 3.x & gcc 4.x by configuring kernel with all i2c switches enabled as module, and saw no errors or warnings in i2c.

Applied, thanks.

greg k-h