lkml.org 
[lkml]   [2008]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ide: Build fix for CONFIG_IDE_PROC_FS=n
Elias Oltmanns wrote:

>>>>Recent changes have broken compilation when CONFIG_IDE_PROC_FS is
>>>>not set.

>>>>Signed-off-by: Elias Oltmanns <eo@nebensachen.de>

>>>[...]

>>>>diff --git a/drivers/ide/ide-disk.h b/drivers/ide/ide-disk.h
>>>>index f937772..5254cae 100644
>>>>--- a/drivers/ide/ide-disk.h
>>>>+++ b/drivers/ide/ide-disk.h
>>>>@@ -23,8 +23,10 @@ ide_decl_devset(acoustic);
>>>> /* ide-disk_ioctl.c */
>>>> int ide_disk_ioctl(struct inode *, struct file *, unsigned int,
>>>>unsigned long);
>>>> +#ifdef CONFIG_IDE_PROC_FS
>>>> /* ide-disk_proc.c */
>>>> extern ide_proc_entry_t ide_disk_proc[];
>>>> extern const struct ide_proc_devset ide_disk_settings[];
>>>>+#endif /* CONFIG_IDE_PROC_FS */
>>>> #endif /* __IDE_DISK_H */

> [...]

>>> Is surrounding 'extern' declarations by #ifdef's really of any value?
>>> They shouldn't be used if CONFIG_IDE_PROC_FS=n, so no object file
>>>records should be generated.

>> Ah, you probably mean to turn the possible link time errors if the
>>do get referenced into the compile time errors...

> Sorry, I don't quite understand that last sentence.

If a variable declared 'extern' is referenced but the module containing
its definition is not linked in, you get unresolved symbol at link time, if
the declaration is missing altogether, you get error at compile time...

> But we definitely
> have compile time errors here because the compiler doesn't even know of
> ide_proc_entry_t when CONFIG_IDE_PROC_FS is not set. Therefore the
> forward declarations appear to be syntactically incorrect, regardless
> whether extern or not.

Ah. I should've looked at the types of those variables, stupid/hasty me...

> Regards,

> Elias

MBR, Sergei


\
 
 \ /
  Last update: 2008-08-30 18:31    [W:0.096 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site