Lint error in v2.9.1
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Lint error in v2.9.1
I'm getting the following lint error:
c:\nburn\include/iosys.h 168 error 4376: conflicting types for 'select'
int select( int nfds,
^
c:\nburn\gcc-m68k\bin\../lib/gcc/m68k-unknown-elf/8.1.0/../../../../m68k-unknown-elf/include\sys\select.h
73 supplemental 891: previous declaration is here
int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
I think the issue is that the function declaration in iosys.h has the fifth argument as a pointer to an unsigned long, whereas in the GCC file select.h the fifth argument is a pointer to a structure.
c:\nburn\include/iosys.h 168 error 4376: conflicting types for 'select'
int select( int nfds,
^
c:\nburn\gcc-m68k\bin\../lib/gcc/m68k-unknown-elf/8.1.0/../../../../m68k-unknown-elf/include\sys\select.h
73 supplemental 891: previous declaration is here
int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
I think the issue is that the function declaration in iosys.h has the fifth argument as a pointer to an unsigned long, whereas in the GCC file select.h the fifth argument is a pointer to a structure.
Re: Lint error in v2.9.1
We will fix these asap...
Re: Lint error in v2.9.1
Hello,
This isn't actually an issue with the flags we use. During compilation, the include order will include the sys-include select.h first, as it is higher in the search priority list. And if you go look in the sys-include folder, you will see that the select is commented out. Are you sure you are passing the same flags that we build with to your linter?
This isn't actually an issue with the flags we use. During compilation, the include order will include the sys-include select.h first, as it is higher in the search priority list. And if you go look in the sys-include folder, you will see that the select is commented out. Are you sure you are passing the same flags that we build with to your linter?
Code: Select all
fstanley@Arete ..m68k/windows/gcc-m68k/m68k-unknown-elf (git)-[Rel_2_9-gcc8] % echo | m68k-elf-gcc -E -Wp,-v -
#include "..." search starts here:
#include <...> search starts here:
/Applications/NetBurner/gcc-m68k/bin/../lib/gcc/m68k-unknown-elf/8.1.0/include
/Applications/NetBurner/gcc-m68k/bin/../lib/gcc/m68k-unknown-elf/8.1.0/include-fixed
/Applications/NetBurner/gcc-m68k/bin/../lib/gcc/m68k-unknown-elf/8.1.0/../../../../m68k-unknown-elf/sys-include
/Applications/NetBurner/gcc-m68k/bin/../lib/gcc/m68k-unknown-elf/8.1.0/../../../../m68k-unknown-elf/include
End of search list.
Forrest Stanley
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Lint error in v2.9.1
I'm not having a compiler issue. My application does not even call select. It's my lint utility that is complaining. It sounds as if I can suppress the lint warning and not worry about it.
Re: Lint error in v2.9.1
Your link should be following the defines and compiler settings that select what is and is not part of the compilation.
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Lint error in v2.9.1
"... the include order will include the sys-include select.h first"
There is no select.h file in directory /m68k-unknown-elf/sys-include, or am I misunderstanding you?
There is no select.h file in directory /m68k-unknown-elf/sys-include, or am I misunderstanding you?
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Lint error in v2.9.1
Did the GCC directory layout change from v5.2 to v8.1?
This path was not part of v5.2:
Adding the above path in the same place as shown by Forrest removes the warning.
This path was not part of v5.2:
Code: Select all
--i"c:\nburn\gcc-m68k\bin\../lib/gcc/m68k-unknown-elf/8.1.0/../../../../m68k-unknown-elf/sys-include"
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Lint error in v2.9.1
I spoke too soon. Adding that path fixed one of my projects, but not the others. Some projects are NANO and some are MOD5441X.
When I look in c:\nburn\gcc-m68k\m68k-unknown-elf\include\sys\select.h, the only protection to keep the file from being processed is the following statement:
I searched every directory in the nburn installation sub-directories and none of those macros are ever defined, and if I understand correctly the comments which precedes #if none of them should be defined. Which means the file will be processed and the incorrect version of select will be defined.
After beating my head against the wall for days trying figure out why and how to correct it, I threw in the towel and altered the file by adding one line before the guard statement.
All my projects still compile without error, and lint no longer throws errors for every file in every project. I didn't have this issue with GNU v5.2.
Hopefully I didn't introduce some obscure bug.
When I look in c:\nburn\gcc-m68k\m68k-unknown-elf\include\sys\select.h, the only protection to keep the file from being processed is the following statement:
Code: Select all
# if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
...
#endif /* !(_WINSOCK_H || _WINSOCKAPI_ || __USE_W32_SOCKETS) */
After beating my head against the wall for days trying figure out why and how to correct it, I threw in the towel and altered the file by adding one line before the guard statement.
Code: Select all
#define _SYS_SELECT_H // ADDED TO PREVENT INCLUSION!!!
#ifndef _SYS_SELECT_H
#define _SYS_SELECT_H
...
Hopefully I didn't introduce some obscure bug.