Skip to content

Commit 9d82973

Browse files
committed
gcc-10 warnings: fix low-hanging fruit
Due to a bug-report that was compiler-dependent, I updated one of my machines to gcc-10. That shows a lot of new warnings. Happily they seem to be mostly the valid kind, but it's going to cause a round of churn for getting rid of them.. This is the really low-hanging fruit of removing a couple of zero-sized arrays in some core code. We have had a round of these patches before, and we'll have many more coming, and there is nothing special about these except that they were particularly trivial, and triggered more warnings than most. Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0e698df commit 9d82973

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/linux/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ struct file_handle {
983983
__u32 handle_bytes;
984984
int handle_type;
985985
/* file identifier */
986-
unsigned char f_handle[0];
986+
unsigned char f_handle[];
987987
};
988988

989989
static inline struct file *get_file(struct file *f)

include/linux/tty.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct tty_buffer {
6666
int read;
6767
int flags;
6868
/* Data points here */
69-
unsigned long data[0];
69+
unsigned long data[];
7070
};
7171

7272
/* Values for .flags field of tty_buffer */

scripts/kallsyms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct sym_entry {
3434
unsigned int len;
3535
unsigned int start_pos;
3636
unsigned int percpu_absolute;
37-
unsigned char sym[0];
37+
unsigned char sym[];
3838
};
3939

4040
struct addr_range {

0 commit comments

Comments
 (0)