From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redback.com (J.T. Conklin) To: Andrew Cagney Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [RFA]: Remove unused header files. Date: Fri, 02 Mar 2001 16:34:00 -0000 Message-id: <5mpufzlmg5.fsf@jtc.redback.com> References: <5mitltndwn.fsf@jtc.redback.com> <3A9FC8E8.F1B486C5@cygnus.com> X-SW-Source: 2001-03/msg00045.html >>>>> " Andrew" == Andrew Cagney writes: Andrew> GDB currently has some really obscure and effectivly hidden include Andrew> dependencies. For instance, given the target mn10200-elf you find: Andrew> Andrew> values.c uses EXTRACT_RETURN_VALUE Andrew> Andrew> config/mn10200/tm-mn10200.h's definition Andrew> refers to something declared in regcache.h Andrew> Andrew> values.c includes "tm.h" to get at EXTRACT_RETURN_VALUE and Andrew> consequently needs a declaration for regcache.h. Andrew> Andrew> Does your lint handle this? Yes and no. If I was linting GDB configured for the mn10200, it regcache.h would be considered necessary, but for other cases it would not. Since I'm not planning on linting every possible config before deciding whether a header is unnecessary, it's not up to the job. However, I question whether it has to be. Why should GDB have obscure and effectively hidden include dependencies? We can eliminate them so that *.c files include the headers that are required by all configs, and have tm-, nm-, or xm- headers that require extra headers due to macro definitions to include them themselves. Alternatively, we can include all the headers in defs.h to ensure that all such headers have access to the declarations. I'm not fond of the latter --- I'm trying to decrease the number of headers being processed for each module, not increase them. I think requiring the tm-, nm-, and xm- headers to include dependent headers is desirable. While it will add some compilation overhead to some configs, it should be only until they are multi-arched. That can be addressed even before multi-arch, since the macros can be converted to functions and moved to the appropriate -tdep.c or -nat.c file. --jtc -- J.T. Conklin RedBack Networks