Recent

Author Topic: OpenBSD error: Illegal character in format string.  (Read 20233 times)

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: OpenBSD error: Illegal character in format string.
« Reply #15 on: January 03, 2016, 04:35:07 pm »
Rather odd. Having no thousandseparator, OK, but having no DecimalSeparator?
(Pascal does not mind having a #0 in a string, no WS is going to display it).

Out of curiousity, what is the output of FloatToStr(1.23) (using sysutils+clocale unit)?

Bart

crsc

  • New Member
  • *
  • Posts: 14
Re: OpenBSD error: Illegal character in format string.
« Reply #16 on: January 03, 2016, 04:41:45 pm »
Bart, you found the next bug in clocale. Very strange.

The output is:

FloatToStr(1.23) = "123"

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: OpenBSD error: Illegal character in format string.
« Reply #17 on: January 03, 2016, 04:46:32 pm »
I added a note in the bugtracker.

Bart

crsc

  • New Member
  • *
  • Posts: 14
Re: OpenBSD error: Illegal character in format string.
« Reply #18 on: January 20, 2016, 11:20:04 am »
I was busy for a while but today I tried to fix some things. It's impossible to build fpc on OpenBSD. How are the OpenBSD-packages build? Via cross compiling? In the attached file you will find the build error, if you are interested. Any idea, what the problem can be?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: OpenBSD error: Illegal character in format string.
« Reply #19 on: January 20, 2016, 12:18:21 pm »
Quote
Error: Path "./" does not exist

Sounds like something goes wrong with expanding paths. (expandfilename/fexpand and everything it depends on (readdir*) and one very special routine).

To avoid shell problems, use bash as shell.

The release has the following warning in the readme:

Quote
The release has been generated on a virtual machine running OpenBSD release 4
  It may not work on more recent OpenBSD releases.

  WARNING: on a 5.4 vmware virtual machine, installation produces a kernel erro
  Due to changes in system structure layouts like dirent and stat structures
this release is not working on any system post-5.4 either.

  Any help in maintaining OpenBSD target for Free Pascal would be most welcome!
See Free Pascal website:
http://www.freepascal.org

Pierre Muller

In short, it is for openBSD 4, and not 5, and that could explain the locale issues too, as well as the expandfile problems (which are dirent dependent)

crsc

  • New Member
  • *
  • Posts: 14
Re: OpenBSD error: Illegal character in format string.
« Reply #20 on: January 20, 2016, 02:03:43 pm »
Thank you for your answer. I'll do some test builds with an old version of OpenBSD and do tests with the clocale / formatsettings functions.

ab1jx

  • New Member
  • *
  • Posts: 23
    • Just some photos on Nikonians
Re: OpenBSD error: Illegal character in format string.
« Reply #21 on: February 04, 2016, 06:20:14 am »
I just wanted to say that OpenBSD does NOT have a working locale, the problem crops up with other things too.

Superdisk

  • Jr. Member
  • **
  • Posts: 73
Re: OpenBSD error: Illegal character in format string.
« Reply #22 on: March 05, 2022, 04:39:57 pm »
I'm running into this same issue now. It affects Lazarus, since in Lazarus 2.2.0, there are 3 instances of clocale:

Code: [Select]
➜  lazarus-lazarus_2_2_0 grep -nirI "clocale" .
./components/datetimectrls/datetimepicker.pas:46:  { clocale, // needed to initialize default locale settings on Linux. }
./components/lazreport/source/lr_class.pas:20:{ CLocale, }
./ide/lazarus.pp:54:  { clocale, }

I hacked around it by just commenting them out for now.

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: OpenBSD error: Illegal character in format string.
« Reply #23 on: March 05, 2022, 05:26:53 pm »
If you feel obliged to answer on a six+ years old thread, plz give a compilable example, because OpenBSD has no issues in this particular field I am aware of. Otherwise someone would have complained in the mean time.... OpenBSD is well maintained, although not very mainstream. (Users tend to be network pro's)
Marco has a lot of knowledge about the BSD flavors, as well as some others on the forum.
« Last Edit: March 05, 2022, 05:34:05 pm by Thaddy »
Specialize a type, not a var.

Superdisk

  • Jr. Member
  • **
  • Posts: 73
Re: OpenBSD error: Illegal character in format string.
« Reply #24 on: March 05, 2022, 05:35:25 pm »
I don't see anything wrong with bumping an old thread, especially if it's still relevant today.

Code: Pascal  [Select][+][-]
  1. program asdf;
  2. uses clocale, sysutils;
  3.  
  4. begin
  5.    writeln('yeah', floattostr(1.23));
  6.         with FormatSettings do begin
  7.      writeln(CurrencyFormat);
  8.      writeln(NegCurrFormat);
  9.      writeln(Ord(ThousandSeparator));
  10.      writeln(Ord(DecimalSeparator));
  11.      writeln(CurrencyDecimals);
  12.      writeln(DateSeparator);
  13.      writeln(TimeSeparator);
  14.      writeln(ListSeparator);
  15.      writeln(CurrencyString);
  16.      writeln(ShortDateFormat);
  17.      writeln(LongDateFormat);
  18.      writeln(TimeAMString);
  19.      writeln(TimePMString);
  20.      writeln(ShortTimeFormat);
  21.      writeln(LongTimeFormat);
  22.      writeln(ShortMonthNames[1]);
  23.      writeln(LongMonthNames[1]);
  24.      writeln(ShortDayNames[1]);
  25.      writeln(LongDayNames[1]);
  26.      writeln(TwoDigitYearCenturyWindow);
  27.         end;
  28. end.

Here's the compilable code-- note that DecimalSeparator and the date formats are still screwed up and show the same output as in the previous post in this thread.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: OpenBSD error: Illegal character in format string.
« Reply #25 on: March 05, 2022, 06:38:42 pm »
Why would you think this was fixed, when the bugreport is not closed?

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: OpenBSD error: Illegal character in format string.
« Reply #26 on: March 05, 2022, 08:42:58 pm »
I grepped my answer. Could not find "fixed"
BTW you do not take the time to open up a BSD of any flavor...
Specialize a type, not a var.

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: OpenBSD error: Illegal character in format string.
« Reply #27 on: March 06, 2022, 08:58:57 am »
I wrote a small (micro) idea to the GitLab issue linked above.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: OpenBSD error: Illegal character in format string.
« Reply #28 on: March 06, 2022, 06:10:00 pm »
I wrote a small (micro) idea to the GitLab issue linked above.
Curiously this issue at hand did not move to the first page of the bugtracker, even though ATM 9 hours ago you added a note?

Bart

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: OpenBSD error: Illegal character in format string.
« Reply #29 on: March 06, 2022, 06:24:10 pm »
I don't see this issue at the top, as well.

 

TinyPortal © 2005-2018