Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-05

getopts patch for returned longind (for long options)

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bram Kuijvenhoven

Hi!

I found that getlongopts from the getopts unit does not work properly on Mac OS X / PowerPC. The Longind : Longint returned is not valid.

The problem is a cast to a pinteger of a pointer that is in fact a plongint, which seems to break on powerpc, and possibly on other platforms or architectures as well. The attached patch fixes this :)

Note that the getopts unit does not have mode OBJFPC set, nor ANSISTRINGS (well at least not in the unit's source). This limits the use of getopts to options of 255 bytes. getopts also resides in rtl/inc/, so this is no big surprise. Is it possible to move the unit to OBJFPC, such that it supports ansistrings?

Regards,

Bram

Reply by email