| Title | Some forward declarations of *ClassGet() functions are wrong |
| Status | closed |
| Priority | optional |
| Assigned user | Gareth Rees |
| Organization | Ravenbrook |
| Description | Bruce Mitchener reported [1] that PellesC [2] produces many warnings when compiling the MPS, including these: arenavm.c(1770): warning #2166: Inconsistent linkage for 'VMArenaClassGet', previously declared at arenavm.c(1770). arenavm.c(1793): warning #2166: Inconsistent linkage for 'VMNZArenaClassGet', previously declared at arenavm.c(1793). poolmrg.c(292): warning #2166: Inconsistent linkage for 'MRGLinkSegClassGet', previously declared at poolmrg.c(292). poolmrg.c(304): warning #2166: Inconsistent linkage for 'MRGRefSegClassGet', previously declared at poolmrg.c(304). poolamc.c(358): warning #2166: Inconsistent linkage for 'amcSegClassGet', previously declared at poolamc.c(358). poolamc.c(663): warning #2166: Inconsistent linkage for 'amcBufClassGet', previously declared at poolamc.c(663). poolamc.c(1745): warning #2166: Inconsistent linkage for 'AMCFix', previously declared at poolamc.c(30). poolamc.c(2391): warning #2166: Inconsistent linkage for 'AMCPoolClassGet', previously declared at poolamc.c(2391). poolawl.c(281): warning #2166: Inconsistent linkage for 'AWLSegClassGet', previously declared at poolawl.c(281). poolsnc.c(182): warning #2166: Inconsistent linkage for 'SNCBufClassGet', previously declared at poolsnc.c(182). poolsnc.c(258): warning #2166: Inconsistent linkage for 'SNCSegClassGet', previously declared at poolsnc.c(258). |
| Analysis | See my e-mail [3]: "Near the top of arenavm.c there's a forward declaration: static ArenaClass VMArenaClassGet(void); But then line 1770 says: DEFINE_ARENA_CLASS(VMArenaClass, this) which expands to: typedef ArenaClass VMArenaClass; /* ... */ extern VMArenaClass VMArenaClassGet(void); So it looks to me as if the compiler is right and the forward declarations are wrong." |
| How found | customer |
| Evidence | [1] <https://info.ravenbrook.com/mail/2013/05/15/10-36-18/0/>[2] < http://www.smorgasbordet.com/pellesc/>[3] < https://info.ravenbrook.com/mail/2013/05/15/12-57-47/0/> |
| Observed in | 1.111.0 |
| Created by | Gareth Rees |
| Created on | 2013-05-15 12:04:35 |
| Last modified by | Gareth Rees |
| Last modified on | 2013-05-15 21:43:53 |
| History | 2013-05-15 GDR Created. |
| Change | Effect | Date | User | Description |
|---|---|---|---|---|
| 181788 | closed | 2013-05-15 14:18:28 | Gareth Rees | Make forward declarations of various functions consistent with their actual declarations. |