View Issue Details

IDProjectCategoryView StatusLast Update
0018371FPCCompilerpublic2011-07-23 19:02
ReporterJeppe Johansen Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformARM+i386OSWince 
Product Version2.5.1 
Fixed in Version2.6.0 
Summary0018371: Interface declaration of external functions break linking on WinCE
DescriptionThis bug was prompted by this forum post: http://www.lazarus.freepascal.org/index.php/topic,11638.0.html

SDL.pas will indeed generate an external reference with name SDL__PUTENV$PCHAR$$LONGINT instead of _putenv as it should if _putenv is declared in the interface too

On Win32 it works as it should

Attached is a very short example that shows the problem(Compiling for wince will generate an undefined reference to SOMEUNIT_TESTEXTERNAL$LONGINT instead of TestExternal)
TagsNo tags attached.
Fixed in Revision16854
FPCOldBugId
FPCTarget
Attached Files

Activities

2011-01-02 22:46

 

someunit.pas (230 bytes)

Jeppe Johansen

2011-01-02 22:55

developer   ~0044812

Looks like it's related to line 1770 in psub.pas

I don't know why it shouldn't make a stub though for wince?

Florian

2011-01-30 20:18

administrator   ~0045604

Removed condition around psub.pas:1770 as suggested.

Jonas Maebe

2011-01-30 20:42

manager   ~0045609

It's really bad code and is only supported for Delphi compatibility. Normally such definitions should be appear only in the interface of the unit and be made external right away.

Such code is one of the things that can cause recompilation of units that depend on this unit even when it hasn't changed (because the interface crc will change while parsing the implementation section, because the mangled name of that routine changes).

I don't know either why the stub generation was only done on Windows platforms though.

Florian

2011-01-30 20:51

administrator   ~0045613

Well, the stub generation was done even only on part of the windows platforms (win32 yes, wince no).

Issue History

Date Modified Username Field Change
2011-01-02 22:46 Jeppe Johansen New Issue
2011-01-02 22:46 Jeppe Johansen File Added: someunit.pas
2011-01-02 22:55 Jeppe Johansen Note Added: 0044812
2011-01-30 20:18 Florian Fixed in Revision => 16854
2011-01-30 20:18 Florian Status new => resolved
2011-01-30 20:18 Florian Fixed in Version => 2.5.1
2011-01-30 20:18 Florian Resolution open => fixed
2011-01-30 20:18 Florian Assigned To => Florian
2011-01-30 20:18 Florian Note Added: 0045604
2011-01-30 20:42 Jonas Maebe Note Added: 0045609
2011-01-30 20:51 Florian Note Added: 0045613
2011-07-23 19:02 Jeppe Johansen Status resolved => closed