Skip to content

Commit a70a025

Browse files
authored
Merge pull request #3107 from WalterBright/implicitFuncDecl
ImportC: disallow implicit function declaration
2 parents 0e7901f + 61b353b commit a70a025

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/importc.dd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ $(H2 $(LNAME2 implementation, Implementation))
150150
C compiler) on the target platform.
151151
)
152152

153+
$(H3 $(LNAME2 implicit-function-declaration, Implicit Function Declarations))
154+
155+
$(P Implicit function declarations:)
156+
157+
$(CCODE
158+
int main()
159+
{
160+
func(); // implicit declaration of func()
161+
}
162+
)
163+
164+
$(P were allowed in K+R C and C89, but were invalidated in C99 and C11. Although many
165+
C compilers still support them, ImportC does not.
166+
)
167+
168+
$(RATIONALE Implicit function declarations are very error-prone and cause hard
169+
to find bugs.)
153170

154171
$(H2 $(LNAME2 limitations, Limitations))
155172

0 commit comments

Comments
 (0)