Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0015483 [FPC] RTL block always 2010-01-08 19:24 2010-01-13 16:47
Reporter Anton Kavalenka View Status public  
Assigned To Marco van de Voort
Priority normal Resolution fixed  
Status closed   Product Version 2.5.1
Summary 0015483: RTL: TTime is Object Pascal type but not Unix-system type
Description Current SVN head cannot be built under x86_64-linux

TTime cannot be used as Pascal alias of UNIX timestamp types
Additional Information
Tags No tags attached.
FPCOldBugId 0
Fixed in Revision several up to 14601
Attached Files ? file icon time_impact.patch [^] (2,220 bytes) 2010-01-08 19:24
? file icon time_rtl.patch [^] (10,660 bytes) 2010-01-08 21:30
? file icon time_users.patch [^] (1,074 bytes) 2010-01-08 21:30
? file icon time_x11.patch [^] (364 bytes) 2010-01-08 21:30
? file icon time-linux-rtl.patch [^] (558 bytes) 2010-01-09 20:21

- Relationships
child of 0015474acknowledged Lazarus TDate and TTime are not defined in unit System 

-  Notes
(0033519)
Sven Barth (reporter)
2010-01-08 20:51

A quick grep in RTL directory shows that there are some more locations where TTime is used, while a time_t was meant. I'll try to write a patch similiar to the attached one containing all TTime occurences... (it's my fault after all :P )
(0033520)
Sven Barth (reporter)
2010-01-08 21:29

Ok... I'll attach three patches:
* time_rtl.patch replaces all (Unix) TTime types in all RTLs with time_t (includes changes from time_impact.patch)
* time_users.patch replaces two TTime occurences in packages/users
* time_x11.patch: TTime is redefined in x.pp as culong (and used in all x11 units that use TTime). I only moved the PTime type defined there below the TTime declaration to be sure that the correct type is used. If you're sure that not the new System.TTime is used, you might ignore this patch
(0033524)
Marco van de Voort (manager)
2010-01-09 16:39
edited on: 2010-01-09 16:43

This is no solution, since it possibly breaks heaps of headers.

When baseunix was conceived, there was a lot of pressure on me to define friendly pascal/Delphi styleguide T<x> identifiers for everything instead of c-like "time_t" likes.

I didn't know then that Delphi defined a similar type in system.

However if we are going to remove the baseunix stuff, I propose to come clean, and remove all T<X> friendly types, including TOFF etc.

(0033525)
Marco van de Voort (manager)
2010-01-09 17:12

I misunderstood apparantly, from Florian I understood it only goes for the "system unit" implementation scope.

Solved that by postponing aliasing ttime to time_t till unixtype, r14584

FreeBSD now cycles.
(0033526)
Sven Barth (reporter)
2010-01-09 17:36

Also a way to solves this... :)

A little question regarding the PTime pointer in packages/X11/x.pp: Does it refer to the TTime defined directly below it or the TTime defined in system.pp?
(0033527)
Marco van de Voort (manager)
2010-01-09 18:49
edited on: 2010-01-09 18:52

(Edited) I don't know what it does in such circumstances, since ttime is also defined within the same block. Something for the compiler guys.

But probably the whole principle is wrong. It should use the versions from baseunix as much as possible and not import its own.

Since this could break on (32-bit) systems where time_t is already 64-bit, UNLESS the x11 time_t type is independant from the system one.

(0033528)
Sven Barth (reporter)
2010-01-09 20:17
edited on: 2010-01-09 20:22

I don't think it should. The declaration of Time in X.h looks like this:

typedef CARD32 Time

So it's not the same as time_t. The use of the same type names is only in our sources.

Btw: Linux didn't cycle. There was a use of TTime inside system.pp (ossysc.inc)). I'll upload the patch once the cycle is complete.

Edit: patch uploaded. I also replaced the usage of PTime with the "more sane" ptime_t. Linux now cycles again.

(0033529)
Marco van de Voort (manager)
2010-01-09 23:03

Fixed that, and another one when compiling with -dFPC_USE_LIBC
(0033542)
Marco van de Voort (manager)
2010-01-10 16:24

- Reversed x11 ttime/ptime.
- "users" is no problem since importing unix units with ttime in it overrides the system definition

- Issue History
Date Modified Username Field Change
2010-01-08 19:24 Anton Kavalenka New Issue
2010-01-08 19:24 Anton Kavalenka File Added: time_impact.patch
2010-01-08 19:42 Jonas Maebe Relationship added child of 0015474
2010-01-08 20:51 Sven Barth Note Added: 0033519
2010-01-08 21:29 Sven Barth Note Added: 0033520
2010-01-08 21:30 Sven Barth File Added: time_rtl.patch
2010-01-08 21:30 Sven Barth File Added: time_users.patch
2010-01-08 21:30 Sven Barth File Added: time_x11.patch
2010-01-09 16:39 Marco van de Voort Note Added: 0033524
2010-01-09 16:43 Marco van de Voort Note Edited: 0033524
2010-01-09 17:12 Marco van de Voort Note Added: 0033525
2010-01-09 17:36 Sven Barth Note Added: 0033526
2010-01-09 18:49 Marco van de Voort Note Added: 0033527
2010-01-09 18:51 Marco van de Voort Note Edited: 0033527
2010-01-09 18:52 Marco van de Voort Note Edited: 0033527
2010-01-09 18:52 Marco van de Voort Note Edited: 0033527
2010-01-09 20:17 Sven Barth Note Added: 0033528
2010-01-09 20:21 Sven Barth File Added: time-linux-rtl.patch
2010-01-09 20:22 Sven Barth Note Edited: 0033528
2010-01-09 23:03 Marco van de Voort Note Added: 0033529
2010-01-10 16:24 Marco van de Voort Fixed in Revision => several up to 14601
2010-01-10 16:24 Marco van de Voort Status new => resolved
2010-01-10 16:24 Marco van de Voort Fixed in Version => 2.5.1
2010-01-10 16:24 Marco van de Voort Resolution open => fixed
2010-01-10 16:24 Marco van de Voort Assigned To => Marco van de Voort
2010-01-10 16:24 Marco van de Voort Note Added: 0033542
2010-01-10 16:24 Marco van de Voort Target Version => 2.5.1
2010-01-13 16:47 Anton Kavalenka Status resolved => closed



Mantis 1.1.1[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker