FreeBASIC 1.10.0 Release Discussion
FreeBASIC 1.10.0 Release Discussion
Update 2023.05.14:
Forum News Post: Version 1.10.0 Released
Github: FreeBASIC 1.10.0 release on github
Sourceforge: Download files and readme.md
Start of release discussion in this thread:
Jump to the post in this discussion on the 1.10.0 release
Forum News Post: Version 1.10.0 Released
Github: FreeBASIC 1.10.0 release on github
Sourceforge: Download files and readme.md
Start of release discussion in this thread:
Jump to the post in this discussion on the 1.10.0 release
Last edited by coderJeff on May 15, 2023 0:09, edited 2 times in total.
-
- Posts: 755
- Joined: Jul 26, 2018 18:28
Re: FreeBASIC 1.10.0 Development
I can't compile version 1.10.0 on Windows:
---
On Linux, the new version (1.10.0) compiles. But this code:
Gives compiler errors:
Code: Select all
CC src/rtlib/obj/win32/time_weekdayname.o
CC src/rtlib/obj/win32/utf_convfrom_char.o
CC src/rtlib/obj/win32/utf_convto_char.o
CC src/rtlib/obj/win32/utf_convto_wchar.o
CC src/rtlib/obj/win32/utf_core.o
CC src/rtlib/obj/win32/vfs_open.o
CPPAS src/rtlib/obj/win32/cpudetect.o
src/rtlib/x86/cpudetect.s: Assembler messages:
src/rtlib/x86/cpudetect.s:29: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:31: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:32: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:33: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:36: Error: invalid instruction suffix for `pushf'
src/rtlib/x86/cpudetect.s:37: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:40: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:41: Error: invalid instruction suffix for `popf'
src/rtlib/x86/cpudetect.s:42: Error: invalid instruction suffix for `pushf'
src/rtlib/x86/cpudetect.s:43: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:51: Error: invalid instruction suffix for `pushf'
src/rtlib/x86/cpudetect.s:52: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:55: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:56: Error: invalid instruction suffix for `popf'
src/rtlib/x86/cpudetect.s:57: Error: invalid instruction suffix for `pushf'
src/rtlib/x86/cpudetect.s:58: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:66: Error: operand type mismatch for `push'
src/rtlib/x86/cpudetect.s:83: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:84: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:85: Error: operand type mismatch for `pop'
src/rtlib/x86/cpudetect.s:86: Error: operand type mismatch for `pop'
make.exe": *** [src/rtlib/obj/win32/cpudetect.o] Error 1
On Linux, the new version (1.10.0) compiles. But this code:
Code: Select all
Type MyType
c As String
End Type
#define MyTypeFromPtr(__Ptr__) *Cast(MyType Ptr, __Ptr__)
Dim As Any Ptr pMyType = New MyType
MyTypeFromPtr(pMyType).c = "dsdsd"
Untitled.bas(8) error 265: Symbol not a CLASS, ENUM, TYPE or UNION typem before '.'
Re: FreeBASIC 1.10.0 Development
Xusinboy Bekchanov wrote: ↑Dec 18, 2022 5:31 new version (1.10.0)
this code:Code: Select all
Type MyType c As String End Type #define MyTypeFromPtr(__Ptr__) *Cast(MyType Ptr, __Ptr__) Dim As Any Ptr pMyType = New MyType MyTypeFromPtr(pMyType).c = "dsdsd"
Gives compiler errors:Untitled.bas(8) error 265: Symbol not a CLASS, ENUM, TYPE or UNION typem before '.'
Due to the change for version 1.10.0:
- sf.net #811: *(ptr).field should give an error
The operator precedence must be taken into account:
The '.' operator takes precedence on the '*' operator.
See my previous alert message:
fxm wrote: ↑Dec 07, 2022 10:37 Attention users:
The old '#811 *(ptr).field should give an error' bug is now fixed for fbc version 1.10.0 (and later).
I noticed that some used this wrong expression '*(ptr).field' in their code.
They will need to replace it with the valid expression: '(*ptr).field'
Same problem for a pointeur to procedure-pointer 'Ptr_to_ProcPtr'.
Use:
'(*Ptr_to_ProcPtr)()' instead of '*Ptr_to_ProcPtr()'
'(*Ptr_to_ProcPtr)(...)' instead of '*(Ptr_to_ProcPtr)(...)'
(this post because who reads the 'changelog.txt' file besides me ?)
Therefore the proper syntax for your #define is (with outer parentheses):
#define MyTypeFromPtr(__Ptr__) (*Cast(MyType Ptr, __Ptr__))
instead of:
#define MyTypeFromPtr(__Ptr__) *Cast(MyType Ptr, __Ptr__)
Re: FreeBASIC 1.10.0 Development
Weird, I haven't seen any make errors on linux-aarch64, I check for updates daily, currently Version 1.10.0 (2022-12-09)
Re: FreeBASIC 1.10.0 Development
Where do you find the daily build for Linux ?
Re: FreeBASIC 1.10.0 Development
I pull from master branch on git https://github.com/freebasic/fbc.git or are you asking OP, soz.
Re: FreeBASIC 1.10.0 Development
So you are compiling the development version of FreeBASIC?
Re: FreeBASIC 1.10.0 Development
What tool chain are you using? There are no recent changes to 'makefile' or cpudetect.s so if seems unusual that you would suddenly get these errors if you have been regularly building from sources.
-
- Posts: 755
- Joined: Jul 26, 2018 18:28
Re: FreeBASIC 1.10.0 Development
Re: FreeBASIC 1.10.0 Development
hello Xusinboy Bekchanov
the only thing that I can think of that causes the assembler errors is that you are using a very old version of mingw, give the gcc version and assembler version, for example gcc --version and as --version

the only thing that I can think of that causes the assembler errors is that you are using a very old version of mingw, give the gcc version and assembler version, for example gcc --version and as --version
-
- Posts: 755
- Joined: Jul 26, 2018 18:28
Re: FreeBASIC 1.10.0 Development
Hello.
The results are:
I'll try to update them.D:\GitHub\fbc-master>gcc --version
gcc (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
D:\GitHub\fbc-master>as --version
GNU assembler (GNU Binutils) 2.25
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-w64-mingw32'.
-
- Posts: 755
- Joined: Jul 26, 2018 18:28
Re: FreeBASIC 1.10.0 Development
Thank you.fxm wrote: ↑Dec 18, 2022 6:05 Due to the change for version 1.10.0:
- sf.net #811: *(ptr).field should give an error
The operator precedence must be taken into account:
The '.' operator takes precedence on the '*' operator.
See my previous alert message:fxm wrote: ↑Dec 07, 2022 10:37 Attention users:
The old '#811 *(ptr).field should give an error' bug is now fixed for fbc version 1.10.0 (and later).
I noticed that some used this wrong expression '*(ptr).field' in their code.
They will need to replace it with the valid expression: '(*ptr).field'
Same problem for a pointeur to procedure-pointer 'Ptr_to_ProcPtr'.
Use:
'(*Ptr_to_ProcPtr)()' instead of '*Ptr_to_ProcPtr()'
'(*Ptr_to_ProcPtr)(...)' instead of '*(Ptr_to_ProcPtr)(...)'
(this post because who reads the 'changelog.txt' file besides me ?)
Therefore the proper syntax for your #define is (with outer parentheses):
#define MyTypeFromPtr(__Ptr__) (*Cast(MyType Ptr, __Ptr__))
instead of:
#define MyTypeFromPtr(__Ptr__) *Cast(MyType Ptr, __Ptr__)
Re: FreeBASIC 1.10.0 Development
@Jeff,
1) REGRESSION for FBC rev 1.10.0 between mid-July and end-November 2022 ?
The simplest conversion-construction from a derived instance no longer works.
(I have not kept enough previous builds to be more precise on the date of the regression)
Normally an implicit cast (from Child to Parent) should be applied.
However this code works as soon as:
- a copy-constructor is defined (explicitly or implicitly) in Parent,
- or a matching conversion-constructor in Parent,
- or an explicit cast operator to Parent in Child.
2) Otherwise, all other conversion expressions (from Child instance to Parent instance) work !
3) Of all the other conversion cases tested in the entire ''Conversion/Inheritance relating to UDTs via constructors and operators' thread, I found no other regressions.
1) REGRESSION for FBC rev 1.10.0 between mid-July and end-November 2022 ?
The simplest conversion-construction from a derived instance no longer works.
(I have not kept enough previous builds to be more precise on the date of the regression)
Code: Select all
Type Parent
Dim As Integer I
End Type
Type Child Extends Parent
End Type
Dim As Child c
Dim As Parent p = c '' error 24: Invalid data types in 'Dim As Parent p = c'
Sleep
However this code works as soon as:
- a copy-constructor is defined (explicitly or implicitly) in Parent,
- or a matching conversion-constructor in Parent,
- or an explicit cast operator to Parent in Child.
2) Otherwise, all other conversion expressions (from Child instance to Parent instance) work !
Code: Select all
Type Parent
Dim As Integer I
End Type
Type Child Extends Parent
End Type
Dim As Child c
Dim As Parent p1
p1 = c
Sub s1(Byval p As Parent)
End Sub
s1(c)
Function f1() As Parent
Dim As Child c
Function = c
End function
f1()
Function f2() As Parent
Dim As Child c
Return c
End function
f2()
'Dim As Parent p = c '' error 24: Invalid data types in 'Dim As Parent p = c'
Sleep
3) Of all the other conversion cases tested in the entire ''Conversion/Inheritance relating to UDTs via constructors and operators' thread, I found no other regressions.
Re: FreeBASIC 1.10.0 Development
Maybe a side effect of this fix (fbc: typeini):
Note: This variant of the above bug 'Dim As Parent p = Type<Child>(1)' should also compile.sf.net #968: fbc: major changes on how initializers
- fixes/changes how fbc handles pairing of a UDT's (internal) structure and the initializer list given by the user
- new: track the overall initializer size in bytes
- don't allow implicit casting to base types
- pass back the initializer to a parent field for full initialization instead of truncated initialization
- determine next field to initialize based on the overall bytes initialized instead of only the 'next field'
-
- Posts: 755
- Joined: Jul 26, 2018 18:28
Re: FreeBASIC 1.10.0 Development
The solution to this problem, it turns out, is here:
https://stackoverflow.com/questions/526 ... h-for-push
Should have added -m32 before cpudetect.s
Now it compiles correctly.