seed7-users Mailing List for Seed7 (Page 5)
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(9) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
|
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(2) |
Aug
(6) |
Sep
(7) |
Oct
(3) |
Nov
(10) |
Dec
(4) |
2013 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2016 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(3) |
Dec
(3) |
2021 |
Jan
(2) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(12) |
Oct
(4) |
Nov
(17) |
Dec
(3) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(2) |
May
|
Jun
(17) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(12) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anders C. <ca...@gm...> - 2021-02-10 20:38:12
|
Thanks, I'll check it out. Regards Anders Den ons 10 feb. 2021 kl 18:55 skrev Thomas Mertes <tho...@gm...>: > Hi Anders, > > From what I can see your manual build of Seed7 (without installer) works > now. > From your previous mail I assume that your PostgreSQL 13 is installed in: > > C:/Program Files/PostgreSQL/13 > > I installed PostgreSQL on my windows computer and there it is at the same > place. > When I downloaded PostgreSQL I saw that there is just a 64-bit version of > it. > On a 64-bit Windows computer 64-bit programs are usually installed in: > > C:/Program Files > > and 32-bit programs are usually installed in > > C:/Program Files (x86) > > My older PostgreSQL 10 is 32-bit and it is installed in: > > C:/Program Files (x86)/PostgreSQL/10 > > In your version.h file the line: > > #define POINTER_SIZE 32 > > shows that your gcc is a 32-bit compiler. This is the reason why chkccomp.c > does not find your PostgreSQL 13. This is on purpose as using a 64-bit dll > from a 32-bit program will not work. > > The Seed7 installer seed7_05_20191117_win.exe uses a 32-bit gcc. > I decided for 32-bit such that it works on 32-bit and 64-bit Windows > versions. > So you cannot use the gcc from the Seed7 installer. > > But it seems that you already did not use the installer. > That means: Your locally installed MingGW gcc is 32-bit. > > You need to install a 64-bit MinGW (with a 64-bit gcc). > With a 64-bit gcc you are also able to connect to PostgreSQL 13. > > On my Windows computer PostgreSQL 13 was recognized by chkccomp.c. > I was able to come past this DATABASE_ERROR: > > Searching for dynamic libraries failed: libpq.dll > > It turned out that PostgreSQL 13 needs two more dlls in order to > load libpq.dll: > > libcrypto-1_1-x64.dll > libssl-1_1-x64.dll > > I have changed chkccomp.c and sql_post.c to search for these > two dlls also. The definitions regarding PostgreSQL in version.h are: > > #define POSTGRESQL_DLL "C:\\Program Files/PostgreSQL/13/lib/libpq.dll", > "C:\\Program Files/PostgreSQL/13/bin/libpq.dll", "libpq.dll", > #define LIBINTL_DLL "C:\\Program Files/PostgreSQL/13/bin/libintl-8.dll", > "libintl.dll", "libintl-8.dll", "libintl-9.dll", > #define LIBEAY32_DLL "libeay32.dll", > #define LIBCRYPTO_DLL "C:\\Program > Files/PostgreSQL/13/bin/libcrypto-1_1-x64.dll", "libcrypto-1_1-x64.dll", > #define LIBSSL_DLL "C:\\Program > Files/PostgreSQL/13/bin/libssl-1_1-x64.dll", "libssl-1_1-x64.dll", > > I have attached the improved files chkccomp.c and sql_post.c. > > As soon as you have installed a 64-bit gcc you can replace > chkccomp.c and sql_post.c with the attached files and try to > build again. Don't forget to do a > > make clean > > before you start a new attempt to compile Seed7: > > make depend > make > > I hope that helps. > > Regards > Thomas Mertes > |
From: Thomas M. <tho...@gm...> - 2021-02-10 17:55:36
|
Hi Anders, >From what I can see your manual build of Seed7 (without installer) works now. >From your previous mail I assume that your PostgreSQL 13 is installed in: C:/Program Files/PostgreSQL/13 I installed PostgreSQL on my windows computer and there it is at the same place. When I downloaded PostgreSQL I saw that there is just a 64-bit version of it. On a 64-bit Windows computer 64-bit programs are usually installed in: C:/Program Files and 32-bit programs are usually installed in C:/Program Files (x86) My older PostgreSQL 10 is 32-bit and it is installed in: C:/Program Files (x86)/PostgreSQL/10 In your version.h file the line: #define POINTER_SIZE 32 shows that your gcc is a 32-bit compiler. This is the reason why chkccomp.c does not find your PostgreSQL 13. This is on purpose as using a 64-bit dll from a 32-bit program will not work. The Seed7 installer seed7_05_20191117_win.exe uses a 32-bit gcc. I decided for 32-bit such that it works on 32-bit and 64-bit Windows versions. So you cannot use the gcc from the Seed7 installer. But it seems that you already did not use the installer. That means: Your locally installed MingGW gcc is 32-bit. You need to install a 64-bit MinGW (with a 64-bit gcc). With a 64-bit gcc you are also able to connect to PostgreSQL 13. On my Windows computer PostgreSQL 13 was recognized by chkccomp.c. I was able to come past this DATABASE_ERROR: Searching for dynamic libraries failed: libpq.dll It turned out that PostgreSQL 13 needs two more dlls in order to load libpq.dll: libcrypto-1_1-x64.dll libssl-1_1-x64.dll I have changed chkccomp.c and sql_post.c to search for these two dlls also. The definitions regarding PostgreSQL in version.h are: #define POSTGRESQL_DLL "C:\\Program Files/PostgreSQL/13/lib/libpq.dll", "C:\\Program Files/PostgreSQL/13/bin/libpq.dll", "libpq.dll", #define LIBINTL_DLL "C:\\Program Files/PostgreSQL/13/bin/libintl-8.dll", "libintl.dll", "libintl-8.dll", "libintl-9.dll", #define LIBEAY32_DLL "libeay32.dll", #define LIBCRYPTO_DLL "C:\\Program Files/PostgreSQL/13/bin/libcrypto-1_1-x64.dll", "libcrypto-1_1-x64.dll", #define LIBSSL_DLL "C:\\Program Files/PostgreSQL/13/bin/libssl-1_1-x64.dll", "libssl-1_1-x64.dll", I have attached the improved files chkccomp.c and sql_post.c. As soon as you have installed a 64-bit gcc you can replace chkccomp.c and sql_post.c with the attached files and try to build again. Don't forget to do a make clean before you start a new attempt to compile Seed7: make depend make I hope that helps. Regards Thomas Mertes |
From: Thomas M. <tho...@gm...> - 2021-02-07 19:15:35
|
Hi Anders, It seems that you have still problems unrelated to Seed7. You wrote: > 1. Extract seed7 folder > In seed7/src there is no config.h file, but _config.h exist. > There are also some other files missing which now start with _ Seed7 does not have any files that start with _ like _config.h. So I guess that your extracting tool produces them. What tool you are using to extract? > 2. Renamed all the files starting with _ This should never be necessary. You should probably delete the directory that this extraction tool created and use a better tool to extract the Seed7 archive. Maybe the tar7.exe commandline tool is useful for you. See: https://sourceforge.net/projects/seed7/files/bin/ You can put tar7.exe in a directory that is in the search path. On windows computers I usually have a directory like c:\Users\tm\bin with the *.exe files of some tools I like. In order to accessable this directory needs to be added to the PATH environment variable. > 3. Start cmd-window in admininistrator mode Compiling Seed7 does not need admininistrator rights. You should just use a normal cmd-window. Later you need administrator rights to do the install, but you will be asked for that with a popup window that mentions setwpath.exe. > 4. copy mk_mingw.mak makefile Okay. > 5. Edit the makefile adding the following rows under the heading chkccomp.h: > echo #define POSTGRESQL_LIBRARY_PATH "C:/Program Files/PostgreSQL/13/include" >> chkccomp.h > echo #define POSTGRESQL_LIBS "C:/Program Files/PostgreSQL/13/lib/libpq.lib" >> chkccomp.h > echo #define POSTGRESQL_DLL "C:/Program Files/PostgreSQL/13/lib/libpq.dll" >> chkccomp.h These settings are wrong and they should not be necessary. Normally chkccomp.c should know that verson 13 of PostgreSQL exists. Unfortunately this knowledge is missing in the chkccomp.c of Seed7 version 2021-01-30. I will sent you an intermediate release which should support verson 13 of PostgreSQL. Please tell me if that works. > 6. Turn off the anti-virus program (McAfee) > 7. Run mingw32-make depend > OK > 8. Run mingw32-make > OK Don't forget to turn you anti-virus program on again later. > 9. Run mingw32-make s7c > Caused a lot of errors see the attached file install_1.txt. > Probably my attempt to rename the files previously was not the right thing to do? The file install_1.txt shows that more files are missing. These missing include files are mentioned: seed7/lib/null_file.s7i seed7/lib/comp/config.s7i seed7/lib/comp/const.s7i seed7/lib/comp/con_act.s7i Probably your extraction tool added also an _ to the name. You definitively should use a different tool to extract *.tgz files. > Then reinstalled the latest version from 20210130 using the win-installer > and now this worked OK. The Seed7 installer uses its own extraction library, so it can avoid the problems that your extraction tool triggers. The installer uses also its own make library (see make.s7i) and its own gcc from the directory seed7/gcc, so it does not depend on mingw32-make and your local installation of gcc. BTW at: https://sourceforge.net/projects/seed7/files/bin/ you can find make7.exe, which can be used as make tool like mingw32-make. > Message from the DATABASE_ERROR exception: > Searching for dynamic libraries failed: C:/Program Files/PostgreSQL/13/lib/libpq.dll This message is triggered by the fact that libpq.dll depends on two other dlls: libintl.dll and libeay32.dll For libpq.dll you specified the absolute path: C:/Program Files/PostgreSQL/13/lib/libpq.dll Unfortunately the windows function to load a dll does not look for other dlls (libintl.dll and libeay32.dll), on which libpq.dll depends, in the same directory. As a result the attempt to load libpq.dll fails. I will send you an intermediate release of Seed7, which will contain fixes in chkccomp.c to solve your problem regarding PostgreSQL. I have improved chkccomp.c in two areas: 1. It now knows about PostgreSQL version 13. This means it will look into "C:/Program Files/PostgreSQL/13/" to search for include files and libraries. Changes in the makefile (chkccomp.h) should be not necessary. Please tell me if it works without these changes. 2. If you define POSTGRESQL_DLL with an absolute path of libpq.dll in the makefile (as you did) the program chkccomp.c now computes absolute paths for libintl.dll and libeay32.dll (in the same directory as libpq.dll). Please tell me if the intermediate release works. Regards Thomas Mertes |
From: Thomas M. <tho...@gm...> - 2021-02-06 17:53:57
|
Hi Zachary, thank you very much for your bug report. In order to compute trunc() and round() Seed7 relies on the cast operation of C (assuming that this operation is fast). Because in C a cast of a double to an integer could return wrong results Seed7 does additional checks for the minimum and maximum allowed argument of trunc() and round(). These values are determined by chkccomp.c and stored in version.h. The file version.h that you sent contains the following line #define MAXIMUM_TRUNC_ARGUMENT 9223372036854775807 that means that the maximum result of trunc() and round() is 9223372036854775807. E.g.: trunc(9223372036854776832.0) -> 9223372036854775807 trunc(9223372036854776833.0) -> RANGE_ERROR On my x64 Linux computer version.h contains: #define MAXIMUM_TRUNC_ARGUMENT 9223372036854775295 this means that trunc() and round() never return 9223372036854775807. E.g.: trunc(9223372036854775295.0) -> 9223372036854774784 trunc(9223372036854775296.0) -> RANGE_ERROR The tests in chkflt.sd7 of release 2021-01-30 do not take into account, that MAXIMUM_TRUNC_ARGUMENT might have the value 9223372036854775807. Recently I compiled Seed7 under Android and there is the same problem. I adjusted the tests in chkflt.sd7 to allow that either the correct value of 9223372036854775807 is returned or RANGE_ERROR is raised. These changes are already checked in at GitHub (https://github.com/ThomasMertes/seed7 ). The next release of Seed7 at Sourceforge will also contain these fixes. Regards Thomas |
From: Zaakari <Za...@pr...> - 2021-02-06 13:34:18
|
Hey Thomas, I have recently installed a Linux distribution named Solus (version 4.2), and attempted to install the latest version of Seed7 (2021-01-30) using gcc. Everything seemed to go fine (after I installed the X11 development package), but I encountered some float errors when using "make test". I have attached a zip folder containing the output from all of the make commands (the last one being the important one) as well as the version.h file. After the errors, the test proceeded a bit farther. It was taking a long time (more than usual), so I let it run over night. However, in the morning it still hadn't finished (was on chkset), so I stopped the process. If you wouldn't mind taking a look, that would be great. Thanks, Zachary |
From: Thomas M. <tho...@gm...> - 2021-01-29 11:57:21
|
Hi Anders, Sorry for the delayed response. It really looks like a problem with your computer and not like a problem caused by Seed7. Great that you did not give up and wrote a new error report. You are the only one that reports this "+Access is denied." problem and up to now I am not able to reproduce it on my windows computer. The + in this error message tells me that it happens in chkccomp.c in the function doTest() (as doTest() writes a "+"). Chkccomp.c works like this: It writes tiny test programs with names like "ctest1.c". Then the C compiler is used to compile and link these test programs. On your windows computer this should result in an executable like: "ctest1.exe". This executable is executed by doTest(). In doTest() this is done in the following line: returncode = system(command); The call of system() triggers the "Access denied" error somehow. Afterwards returncode is tested and in case of -1 nothing is done. I changed the code in doTest() to write something if returncode is -1: if (returncode != -1) { sprintf(fileName, "ctest%d.out", testNumber); outFile = fopen(fileName, "r"); if (outFile != NULL) { fscanf(outFile, "%d", &result); fclose(outFile); } /* if */ } else { printf("\nsystem(\"%s\") failed with errno: %d.\n ", command, errno); } /* if */ Neither on Linux nor on Windows this "failed with errno" message ever pops up. On my computers this call of system() never fails. You might add an printf("\nsystem(\"%s\") succeeded.\n ", command); directly after if (returncode != -1) { to find out if system() succeeds here at all. Do not forget to do a mingw32-make clean before every new attempt to compile Seed7. If system() succeeded at all you might add an exit(0); after printf("\nsystem(\"%s\") failed with errno: %d.\n ", command, errno); to stop chkccomp in case system() fails and then examine the executable that system() tried to execute. It is probably either missing at all or it does not have execute permissions. But it can also be okay and some anti-virus software causes the "Access denied" error (see below). After the exit(0) the source of this test program should be there also (something like ctest1.c). You can try to compile and execute this test program manually. In the internet I found someone else where system() triggered an "Access denied" error: https://stackoverflow.com/questions/28789060/system-function-on-windows-7-failed-with-access-denied-error There it is mentioned that the %comspec% environment variable is used by system(). On my windows computer %ComSpec% has the value c:\windows\system32\cmd.exe It is also mentioned that some anti-virus software triggers the problem. In the past I also had problems with anti-virus software. Avira considered some of the test programs of chkccomp.c as "dangerous" and locked them up under quarantine. Needless to say: These test programs are NOT dangerous. I deactivated Avira because of this (this computer is only used for Seed7 tests). Anti-virus software usually tries to inspect every program that is started. So maybe your anti-virus software triggers the "Access denied" error. BTW: I am quite sure that not all calls of system() fail, since system() is also used to call the C compiler (and the compilation of test programs seems to succeed). This is also a hint towards anti-virus. That administrator rights do not help hints also towards anti-virus. The later error when wrdepend.c is compiled looks even more suspicious: gcc wrdepend.c -o wrdepend wrdepend.c:47:20: ÷desdigert fel: config.h: No such file or directory #include "config.h" ^ kompilering avslutad. The file config.h is part of the Seed7 release. This file is neither used in the makefile nor in chkccomp.c. If gcc cannot find it you might not have all files from the Seed7. Maybe your disk is full. Strange that the installation with seed7_05_20191117_win.exe works. This installer internally uses chkccomp.c also. The only difference is that it uses make.s7i (the Seed7 make library) instead of mingw32-make. But seed7_05_20191117_win.exe can also download the newest version of Seed7 from the internet and compile that. What happens if you choose that option? If seed7_05_20191117_win.exe cannot download the newest version it can also use a manually downloaded version. What happens if you do that? I assume that you used mk_mingw.mak as makefile. If not please tell me. In the future please add also your version.h file. This file contains information which values chccomp.c was able to determine. I hope this helps. Regards Thomas Mertes |
From: Thomas M. <tho...@gm...> - 2021-01-06 09:58:18
|
Hi Zachary, I have fixed this issue, and in the next release it will work without problems. Here is an explanation, how this error was triggered: "in" parameters have been handled different than other parameters (“inout”, “in var”, “ref” or “val”). The other parameters are defined in the beginning of seed7_05.s7i as functions that take the type as argument. This can be parsed before the actual type declaration has been executed. E.g.: inout array array string: aName can be parsed. When this expression is executed the new two-dimensional array type is generated and passed to the "inout" parameter function. The "in" parameters have been defined as attribute of a type (they have been declared in the functions IN_PARAM_IS_VALUE respectively IN_PARAM_IS_REFERENCE). To parse an expression with an attribute the type must exist. Therefore parsing in array array string: aName fails, as the new two-dimensional array type will be generated later, when the expression is executed. I solved this issue by defining "in" parameters the same way as all other parameters. Now "in" parameters are not defined as attribute of a type, but as function that takes the type as argument. What an "in" parameter should do is now stored directly in the type. The functions IN_PARAM_IS_VALUE and IN_PARAM_IS_REFERENCE have been changed to store this information in the type. Regards Thomas Mertes |
From: Zachary M. <zao...@ou...> - 2020-12-19 15:46:31
|
Hey, I encountered an issue while trying to use a two-dimensional array as a procedure’s parameter. If I declare the parameter as type “in” then a match error is raised when I try to run the program. However, if I declare the parameter as anything else (“inout”, “in var”, “ref” or “val”), then the program runs fine. I have attached a sample program as a quick demonstration. Run it as is, and the error will be thrown. Change the parameter type to another value and the program will run without issue. Perhaps this is due to the “in” type not being able to determine whether to use “var” or “ref” on a multi-dimensional array. |
From: L. S. <lsp...@gm...> - 2020-12-17 22:27:03
|
Thank you for the detailed answer. 1. Make sense. 2. I think it solves my problem, has to experiment with this. In my elf-reader I could use case statements but in other projects I may need this. It looks like an elegant solution. 3. Well not just an alias. One of the reasons why I try to learn Seed7 is the static type system (seems more predictable). Den søn. 6. dec. 2020 kl. 22.18 skrev Thomas Mertes <tho...@gm...>: > Great that you are writing a program to read elf-files. This is something > that > Seed7 is currently missing. > > Regarding your questions: > > 1. Using functions from bytedata.s7i is IMHO the right approach. Read the > data > directly into a structure is not supported. > > In Seed7 there are no integer types of various sizes like in C or ASM, > where types with 1, 2, 4 and 8 bytes exist. This was a design decision > driven by the "one size fits all" principle used in Seed7. In many cases > this "one size fits all" makes programming easier, since you can just > use > integer (or bigInteger if an 64-bit integer is not enough) instead of > thinking which size of integer you want to use. As a consequence it is > not > possible to create a struct which has a 1:1 mapping to the data in a > file. Therefore you cannot read data directly into a struct and you > need to > write a function to read a structure from a file. > > In C and ASM reading data directly into a structure can also trigger > problems. If the data structure in the file uses big-endian integers and > your program runs on a little-endian computer direct reading > into a structure will not work in C and ASM. C and ASM would need the > possibility to specify if an integer is big- or little-endian to fully > support reading data structures directly. > > This is the reason bytedata.s7i supports reading big-endian and > little-endian values. The explicit conversions make it obvious, what is > going on. > > 2. A call-by-name parameter is not the same as a function pointer in C. > E.g.: In > if aVariable = 5 then > writeln; > end if; > the actual call-by-name parameter > aVariable = 5 > is an expression that is not executed immediately. > A call-by-name parameter corresponds to the combination of a function > pointer (to a function without parameters) and the environment (local > variables) used by the function. > > Normally I prefer a case statement to have a mapping from integer to > code > to be executed. Usually this is also easy to read, as the case labels > and > the code stand nearby. In compiled programs case statements are > translated > usually to efficient machine code. > > You mentioned many possibilities. How much is many? > > In file formats integers often correspond to enumeration types. If the > integers are converted to an enumeration type object orientation can be > used to execute code depending on the enumeration value. E.g.: > > ---------- begin enumfuncts.sd7 ---------- > $ include "seed7_05.s7i"; > > const type: anEnumType is new enum > ONE, TWO, THREE > end enum; > > const proc: doSomething (in anEnumType: anEnum) is DYNAMIC; > > const proc: doSomething (ONE) is func > begin > writeln("one"); > end func; > > const proc: doSomething (TWO) is func > begin > writeln("two"); > end func; > > const proc: doSomething (THREE) is func > begin > writeln("three"); > end func; > > const proc: main is func > begin > doSomething(anEnumType conv rand(0, 2)); > end func; > ---------- end enumfuncts.sd7 ---------- > > 3. The Seed7 type system is static, safe, nominative and manifest. > - Static means that the types are specified at compile time. All > violations of > the type system trigger compilation errors. > - Safe means that there are no operations or conversions that violate the > rules of the type system. > - Nominative means that the compatibility and equivalence of data types is > determined by the name of the type. This means that two struct types > are different even if both structs are defined with the same elements. > - Manifest typing means explicit identification of the type of each > variable > being declared. For example: If variable X is going to store integers > then > its type must be declared as integer. > > Regards > Thomas Mertes > > > > _______________________________________________ > Seed7-users mailing list > See...@li... > https://lists.sourceforge.net/lists/listinfo/seed7-users > |
From: Thomas M. <tho...@gm...> - 2020-12-06 21:18:47
|
Great that you are writing a program to read elf-files. This is something that Seed7 is currently missing. Regarding your questions: 1. Using functions from bytedata.s7i is IMHO the right approach. Read the data directly into a structure is not supported. In Seed7 there are no integer types of various sizes like in C or ASM, where types with 1, 2, 4 and 8 bytes exist. This was a design decision driven by the "one size fits all" principle used in Seed7. In many cases this "one size fits all" makes programming easier, since you can just use integer (or bigInteger if an 64-bit integer is not enough) instead of thinking which size of integer you want to use. As a consequence it is not possible to create a struct which has a 1:1 mapping to the data in a file. Therefore you cannot read data directly into a struct and you need to write a function to read a structure from a file. In C and ASM reading data directly into a structure can also trigger problems. If the data structure in the file uses big-endian integers and your program runs on a little-endian computer direct reading into a structure will not work in C and ASM. C and ASM would need the possibility to specify if an integer is big- or little-endian to fully support reading data structures directly. This is the reason bytedata.s7i supports reading big-endian and little-endian values. The explicit conversions make it obvious, what is going on. 2. A call-by-name parameter is not the same as a function pointer in C. E.g.: In if aVariable = 5 then writeln; end if; the actual call-by-name parameter aVariable = 5 is an expression that is not executed immediately. A call-by-name parameter corresponds to the combination of a function pointer (to a function without parameters) and the environment (local variables) used by the function. Normally I prefer a case statement to have a mapping from integer to code to be executed. Usually this is also easy to read, as the case labels and the code stand nearby. In compiled programs case statements are translated usually to efficient machine code. You mentioned many possibilities. How much is many? In file formats integers often correspond to enumeration types. If the integers are converted to an enumeration type object orientation can be used to execute code depending on the enumeration value. E.g.: ---------- begin enumfuncts.sd7 ---------- $ include "seed7_05.s7i"; const type: anEnumType is new enum ONE, TWO, THREE end enum; const proc: doSomething (in anEnumType: anEnum) is DYNAMIC; const proc: doSomething (ONE) is func begin writeln("one"); end func; const proc: doSomething (TWO) is func begin writeln("two"); end func; const proc: doSomething (THREE) is func begin writeln("three"); end func; const proc: main is func begin doSomething(anEnumType conv rand(0, 2)); end func; ---------- end enumfuncts.sd7 ---------- 3. The Seed7 type system is static, safe, nominative and manifest. - Static means that the types are specified at compile time. All violations of the type system trigger compilation errors. - Safe means that there are no operations or conversions that violate the rules of the type system. - Nominative means that the compatibility and equivalence of data types is determined by the name of the type. This means that two struct types are different even if both structs are defined with the same elements. - Manifest typing means explicit identification of the type of each variable being declared. For example: If variable X is going to store integers then its type must be declared as integer. Regards Thomas Mertes |
From: L. S. <lsp...@gm...> - 2020-11-30 19:56:09
|
The official documentation is not bad, quite good actually, but it's like it's not really enough for a beginner. So I appreciate any answer I get. I'm trying to write a program to read elf-files. I can read the headers of 32bit files but would like to extend it a bit. 64bit will be easy to add afterwards. 1. Currently I read the data and then extracts every field from the string. I wrote my own function to handle little-endian but with bytedata.s7i <http://seed7.sourceforge.net/libraries/bytedata.htm> it all got much cleaner and easier. But...Could I read the data directly into my structure (like in C and ASM) or do I always have to insert it myself? 2. When I read the section table (from the elf file) I get some types and would like to have an array of pointers to functions. If the type is 1 I call myarray[1](), if it is 2 I call myarray[2](); Can I do that? I can use a 'case-statement' but when you have many possibilities it becomes a bit long. 3. How does "type" work? Is it just like "typedef"? Is it just an alias? |
From: Thomas M. <tho...@gm...> - 2020-11-22 17:33:11
|
In the example below the arguments 'a' and 'b' are read at runtime: -------------------- begin l_skov.sd7 -------------------- $ include "seed7_05.s7i"; const proc: tester (in var integer: a, in var integer: b, ref func integer: fun) is func begin writeln("Value of fun: " <& fun); writeln("end"); writeln("inside: a = " <& a); writeln("inside: b = " <& b); end func; const proc: main is func local var integer: a is 0; var integer: b is 0; begin write("a? "); readln(a); write("b? "); readln(b); tester(a, b, a+b); end func; -------------------- end l_skov.sd7 -------------------- The function 'tester' can also work without the parameters 'a' and 'b': -------------------- begin l_skov2.sd7 -------------------- $ include "seed7_05.s7i"; const proc: tester (ref func integer: fun) is func begin writeln("Value of fun: " <& fun); end func; const proc: main is func local var integer: a is 0; var integer: b is 0; begin write("a? "); readln(a); write("b? "); readln(b); tester(a+b); tester(a*b); end func; -------------------- end l_skov2.sd7 -------------------- Regarding your 2nd question: You can write boolean parse "TRUE" because the syntax of the 'parse' operator is defined in the file syntax.s7i with: $ syntax expr: .().parse.() is <- 1; The syntax of function calls like writeln("something") is not defined explicit (in e.g. syntax.s7i). Generally the syntax of all function calls function_name(parameter1, parameter2) is hard coded. The hard coded syntax for function calls requires parentheses around the parameters. If there is a syntax definition then parentheses can be omitted. E.g.: The 'not' operator is defined in syntax.s7i with: $ syntax expr: .not.() is <- 13; This allows you to write not some_expression without parentheses. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. |
From: L. S. <lsp...@gm...> - 2020-11-16 21:15:31
|
Hi Just started learning seed7 a few days ago. Not totally convinced yet but it seems a useful language so far, much better than it's popularity suggests. 1. I'm currently trying to pass a pointer to a function to another function: tester(a,b,myfun(a,b)); const proc: tester (in var integer: a, in var integer: b, ref func integer: fun) is func local begin a := 10; b := 20; writeln("Value of fun: " <& fun); writeln("end"); writeln("inside: a = " <& a); writeln("inside: b = " <& b); end func; The arguments to "myfun" seems to be evaluated when calling tester or at compile time. How do I change the arguments 'a' and 'b' at runtime. 2. By curiosity I wonder why I can write: boolean parse "TRUE" but not writeln "something" [without parentheses!] |
From: Anders C. <ca...@gm...> - 2020-08-24 08:34:43
|
Hi! I encounter problems when trying to run the make depend command, as seen in the attached file "error_install". Operating system: windows 10 Distribution used: ? Source Forge (seed7_05_20200727) C compiler: MinGW GNU c++ Version of Seed7: seed7_05_20200727 Regards Anders Carstensen email: ca...@gm... |
From: Zachary M. <zao...@ou...> - 2020-06-27 19:16:06
|
Hey Thomas, I’ve come across a couple issues regarding the function “buttonPressed” (in the “keybd.s7i” file) that I’d like to bring to your attention (if you’ve got the time to look into them). I attached a file to demonstrate the issues I am having. The first issue is that the function “buttonPressed” doesn’t seem to work unless the function “busy_getc” (or something similar) is continually being called. You can see this in the program I attached if you comment out line 14, then the program can no longer be exited via the ‘q’ key. The second issue is that “buttonPressed” is unable to detect the when the keys “KEY_MOUSE_BACK” and “KEY_MOUSE_FWD” are being pressed; the function simply returns false regardless. You should also be able to see this in the attached program, as nothing will be written to the terminal when the aforementioned buttons are pressed. Other than these, though, I’m loving the extra functionality you’ve added to the input detection system. Thanks again for all your work, Zachary |
From: Thomas M. <tho...@gm...> - 2019-08-19 13:39:31
|
Hi Brett, thank you very much for your report. I forgot adding the line #define SQL_DRIVER_NOPROMPT 0 to the file db_odbc.h. I have attached db_odbc.h. This should fix it. This problem probably affects Linux, when unixODBC is not installed. Under Windows sql.h is usually present. Please tell me if the fix works. Thank you in advance for your effort. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. |
From: Brett S. (Y. M. #1) <bre...@ya...> - 2019-08-19 06:24:27
|
I am running Debian Linux (testing/bullseye), kernel 4.19.37 on a 64 bit machine. The version of the C compiler is 8.3.0 and the complete log file (make depend and then make) is as follows: echo "#define LIST_DIRECTORY_CONTENTS \"ls\"" >> chkccomp.h echo "#define LINKER_OPT_STATIC_LINKING \"-static\"" >> chkccomp.h echo "#define MYSQL_LIBS \"-lmysqlclient\"" >> chkccomp.h echo "#define MYSQL_DLL \"libmysqlclient.so\"" >> chkccomp.h echo "#define MYSQL_USE_LIB" >> chkccomp.h echo "#define SQLITE_LIBS \"-lsqlite3\"" >> chkccomp.h echo "#define SQLITE_DLL \"libsqlite3.so\"" >> chkccomp.h echo "#define SQLITE_USE_LIB" >> chkccomp.h echo "#define POSTGRESQL_LIBS \"-lpq\"" >> chkccomp.h echo "#define POSTGRESQL_DLL \"libpq.so\",\"libpq.so.5\"" >> chkccomp.h echo "#define POSTGRESQL_USE_LIB" >> chkccomp.h echo "#define ODBC_LIBS \"-lodbc\"" >> chkccomp.h echo "#define ODBC_DLL \"libodbc.so\"" >> chkccomp.h echo "#define ODBC_USE_LIB" >> chkccomp.h echo "#define OCI_LIBS \"-lclntsh\"" >> chkccomp.h echo "#define OCI_DLL \"libclntsh.so\"" >> chkccomp.h echo "#define OCI_USE_DLL" >> chkccomp.h echo "#define FIRE_LIBS \"-lfbclient\"" >> chkccomp.h echo "#define FIRE_DLL \"libfbclient.so\"" >> chkccomp.h echo "#define FIRE_USE_DLL" >> chkccomp.h echo "#define PATH_DELIMITER '/'" > version.h echo "#define SEARCH_PATH_DELIMITER ':'" >> version.h echo "#define AWAIT_WITH_SELECT" >> version.h echo "#define USE_TERMINFO" >> version.h echo "#define SIGNAL_HANDLER_CAN_DO_IO" >> version.h echo "#define CONSOLE_UTF8" >> version.h echo "#define OS_STRI_UTF8" >> version.h echo "#define ESCAPE_SHELL_COMMANDS" >> version.h echo "#define OBJECT_FILE_EXTENSION \".o\"" >> version.h echo "#define LIBRARY_FILE_EXTENSION \".a\"" >> version.h echo "#define C_COMPILER \"gcc\"" >> version.h echo "#define CPLUSPLUS_COMPILER \"g++\"" >> version.h echo "#define GET_CC_VERSION_INFO \"gcc --version >\"" >> version.h echo "#define CC_SOURCE_UTF8" >> version.h echo "#define CC_OPT_DEBUG_INFO \"-g\"" >> version.h echo "#define CC_OPT_NO_WARNINGS \"-w\"" >> version.h echo "#define CC_FLAGS \"-ffunction-sections -fdata-sections\"" >> version.h echo "#define CC_ERROR_FILDES 2" >> version.h echo "#define LINKER_OPT_NO_DEBUG_INFO \"-Wl,--strip-debug\"" >> version.h echo "#define LINKER_OPT_OUTPUT_FILE \"-o \"" >> version.h echo "#define LINKER_FLAGS \"-Wl,--gc-sections\"" >> version.h echo "#define SYSTEM_LIBS \"-lm -ldl\"" >> version.h echo "#define SYSTEM_CONSOLE_LIBS \"-lncurses\"" >> version.h echo "#define SYSTEM_DRAW_LIBS \"-lX11\"" >> version.h gcc --version > cc_vers.txt gcc chkccomp.c -o chkccomp ./chkccomp version.h Prepare compile command: done Chkccomp uses /dev/null as null device. Numeric sizes: ############*.+############*.+############*.+############*.+############*.+############*.+############*.############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.############*.+############*.+############*.+############*. determined General settings: ############*.+############*.############*.############*.+############*.############*.############*.+############*.############*.+############*.############*.############*.+############*.############*.############*.############*.############*.############*.############*.############*.############*.############*.############*.############*.+############*.############*.############*.############*.############*.+############*.+#############*.############*.############*.############*.+############*.+############*.+############*.############*.############*.+##############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.############*.+############*.+############*.############*.+#############*.############*.+#############*.+############*.+############*.+############*.+############*.+ determined Numeric properties: ############*.+############*.+############*.+############*.+############*.+############*.############*.+############*.+############*.+############*.+############*.############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.############*.+############*.+############*.+############*.+############*.+############*.+############*.>############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.>############*.############*.+############*.>############*.+############*.+############*.+############*.+############*.+############*.+ determined Advanced settings: ############*.+############*.+############*.############*.+############*.+############*.+############*.############*.+############*.+############*.############*.+############*.+############*.############*.+############*.############*.############*.+############*.############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.+############*.############*.############*.############*. determined ############*.############*. MySql/MariaDb: mysql/mysql.h found in system include directory. ############*. MySql/MariaDb: Linker option: -lmysqlclient ############*. SQLite: sqlite3.h found in system include directory. ############*. SQLite: Linker option: -lsqlite3 ############*. PostgreSQL: libpq-fe.h found in system include directory. ############*.############*.############*. PostgreSQL: catalog/pg_type.h not found in include directories. ############*. PostgreSQL: postgres.h not found in include directories. ############*. PostgreSQL: db_post.h found in Seed7 include directory. ############*. PostgreSQL: Linker option: -lpq ############*.############*.############*. Odbc: db_odbc.h found in Seed7 include directory. ############*. Odbc: DLL / Shared library: libodbc.so ############*.############*. Oracle: db_oci.h found in Seed7 include directory. Oracle: DLL / Shared library: libclntsh.so ############*.############*.############*. Firebird: db_fire.h found in Seed7 include directory. Firebird: DLL / Shared library: libfbclient.so ############*.+############*.############*.+# Macro read_buffer_empty defined. ###### rm chkccomp rm cc_vers.txt echo "#define SEED7_LIB \"seed7_05.a\"" >> version.h echo "#define CONSOLE_LIB \"s7_con.a\"" >> version.h echo "#define DRAW_LIB \"s7_draw.a\"" >> version.h echo "#define COMP_DATA_LIB \"s7_data.a\"" >> version.h echo "#define COMPILER_LIB \"s7_comp.a\"" >> version.h gcc setpaths.c -o setpaths ./setpaths "S7_LIB_DIR=" "SEED7_LIBRARY=" >> version.h rm setpaths gcc wrdepend.c -o wrdepend cp version.h vers_linux.h ./wrdepend -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -M s7.c "> depend" ./wrdepend -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -M arr_rtl.c bln_rtl.c bst_rtl.c chr_rtl.c cmd_rtl.c con_rtl.c dir_rtl.c drw_rtl.c fil_rtl.c flt_rtl.c hsh_rtl.c int_rtl.c itf_rtl.c pcs_rtl.c set_rtl.c soc_rtl.c sql_rtl.c str_rtl.c tim_rtl.c ut8_rtl.c heaputl.c numutl.c sigutl.c striutl.c big_rtl.c big_gmp.c cmd_unx.c dir_win.c dll_unx.c fil_unx.c pcs_unx.c pol_unx.c soc_none.c sql_base.c sql_fire.c sql_lite.c sql_my.c sql_oci.c sql_odbc.c sql_post.c tim_unx.c ">> depend" ./wrdepend -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -M kbd_rtl.c con_inf.c kbd_poll.c trm_inf.c ">> depend" ./wrdepend -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -M gkb_rtl.c drw_x11.c gkb_x11.c ">> depend" ./wrdepend -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -M typ_data.c rfl_data.c ref_data.c listutl.c flistutl.c typeutl.c datautl.c ">> depend" ./wrdepend -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -M runerr.c option.c primitiv.c actlib.c arrlib.c biglib.c binlib.c blnlib.c bstlib.c chrlib.c cmdlib.c conlib.c dcllib.c drwlib.c enulib.c fillib.c fltlib.c hshlib.c intlib.c itflib.c kbdlib.c lstlib.c pcslib.c pollib.c prclib.c prglib.c reflib.c rfllib.c sctlib.c setlib.c soclib.c sqllib.c strlib.c timlib.c typlib.c ut8lib.c exec.c doany.c objutl.c act_comp.c prg_comp.c analyze.c syntax.c token.c parser.c name.c type.c expr.c atom.c object.c scanner.c literal.c numlit.c findid.c error.c infile.c libpath.c symbol.c info.c stat.c fatal.c match.c syvarutl.c traceutl.c actutl.c executl.c blockutl.c entutl.c identutl.c chclsutl.c arrutl.c ">> depend" Use 'make' (with your make command) to create the interpreter. gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o s7.o s7.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o runerr.o runerr.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o option.o option.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o primitiv.o primitiv.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o actlib.o actlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o arrlib.o arrlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o biglib.o biglib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o binlib.o binlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o blnlib.o blnlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o bstlib.o bstlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o chrlib.o chrlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o cmdlib.o cmdlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o conlib.o conlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o dcllib.o dcllib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o drwlib.o drwlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o enulib.o enulib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o fillib.o fillib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o fltlib.o fltlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o hshlib.o hshlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o intlib.o intlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o itflib.o itflib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o kbdlib.o kbdlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o lstlib.o lstlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o pcslib.o pcslib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o pollib.o pollib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o prclib.o prclib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o prglib.o prglib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o reflib.o reflib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o rfllib.o rfllib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sctlib.o sctlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o setlib.o setlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o soclib.o soclib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sqllib.o sqllib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o strlib.o strlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o timlib.o timlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o typlib.o typlib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o ut8lib.o ut8lib.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o exec.o exec.c exec.c: In function ‘exec_lambda’: exec.c:425:44: warning: ‘backup_block_result’ may be used uninitialized in this function [-Wmaybe-uninitialized] block_result->object->value.objValue = backup_block_result; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ exec.c:483:16: note: ‘backup_block_result’ was declared here objectType backup_block_result; ^~~~~~~~~~~~~~~~~~~ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o doany.o doany.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o objutl.o objutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o act_comp.o act_comp.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o prg_comp.o prg_comp.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o analyze.o analyze.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o syntax.o syntax.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o token.o token.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o parser.o parser.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o name.o name.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o type.o type.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o expr.o expr.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o atom.o atom.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o object.o object.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o scanner.o scanner.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o literal.o literal.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o numlit.o numlit.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o findid.o findid.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o error.o error.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o infile.o infile.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o libpath.o libpath.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o symbol.o symbol.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o info.o info.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o stat.o stat.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o fatal.o fatal.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o match.o match.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o syvarutl.o syvarutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o traceutl.o traceutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o actutl.o actutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o executl.o executl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o blockutl.o blockutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o entutl.o entutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o identutl.o identutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o chclsutl.o chclsutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o arrutl.o arrutl.c ar r ../bin/s7_comp.a runerr.o option.o primitiv.o actlib.o arrlib.o biglib.o binlib.o blnlib.o bstlib.o chrlib.o cmdlib.o conlib.o dcllib.o drwlib.o enulib.o fillib.o fltlib.o hshlib.o intlib.o itflib.o kbdlib.o lstlib.o pcslib.o pollib.o prclib.o prglib.o reflib.o rfllib.o sctlib.o setlib.o soclib.o sqllib.o strlib.o timlib.o typlib.o ut8lib.o exec.o doany.o objutl.o act_comp.o prg_comp.o analyze.o syntax.o token.o parser.o name.o type.o expr.o atom.o object.o scanner.o literal.o numlit.o findid.o error.o infile.o libpath.o symbol.o info.o stat.o fatal.o match.o syvarutl.o traceutl.o actutl.o executl.o blockutl.o entutl.o identutl.o chclsutl.o arrutl.o ar: creating ../bin/s7_comp.a gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o typ_data.o typ_data.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o rfl_data.o rfl_data.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o ref_data.o ref_data.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o listutl.o listutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o flistutl.o flistutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o typeutl.o typeutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o datautl.o datautl.c ar r ../bin/s7_data.a typ_data.o rfl_data.o ref_data.o listutl.o flistutl.o typeutl.o datautl.o ar: creating ../bin/s7_data.a gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o gkb_rtl.o gkb_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o drw_x11.o drw_x11.c drw_x11.c: In function ‘redraw’: drw_x11.c:166:13: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] width, height, xPos, yPos); ^~~~~ drw_x11.c:166:20: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] width, height, xPos, yPos); ^~~~~~ drw_x11.c:98:27: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion] #define to_width(win) (((const_x11_winType) win)->width) ^ drw_x11.c:175:20: note: in expansion of macro ‘to_width’ xClear = to_width(expose_window); ^~~~~~~~ drw_x11.c:176:37: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] clearWidth = xPos + width - to_width(expose_window); ^ drw_x11.c:176:24: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion] clearWidth = xPos + width - to_width(expose_window); ^~~~ drw_x11.c:99:27: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion] #define to_height(win) (((const_x11_winType) win)->height) ^ drw_x11.c:182:24: note: in expansion of macro ‘to_height’ yClear = to_height(expose_window); ^~~~~~~~~ drw_x11.c:183:43: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] clearHeight = yPos + height - to_height(expose_window); ^ drw_x11.c:183:29: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion] clearHeight = yPos + height - to_height(expose_window); ^~~~ drw_x11.c:188:55: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] xPos, yClear, to_width(expose_window) - xPos, clearHeight); ^ drw_x11.c:188:63: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] xPos, yClear, to_width(expose_window) - xPos, clearHeight); ^~~~~~~~~~~ drw_x11.c:194:27: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] xClear, yPos, clearWidth, height); ^~~~~~~~~~ drw_x11.c:194:39: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] xClear, yPos, clearWidth, height); ^~~~~~ drw_x11.c:99:27: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion] #define to_height(win) (((const_x11_winType) win)->height) ^ drw_x11.c:202:20: note: in expansion of macro ‘to_height’ yClear = to_height(expose_window); ^~~~~~~~~ drw_x11.c:203:39: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] clearHeight = yPos + height - to_height(expose_window); ^ drw_x11.c:203:25: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion] clearHeight = yPos + height - to_height(expose_window); ^~~~ drw_x11.c:208:27: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] xPos, yClear, width, clearHeight); ^~~~~ drw_x11.c:208:34: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] xPos, yClear, width, clearHeight); ^~~~~~~~~~~ In file included from drw_x11.c:51: drw_x11.c: In function ‘drwPolyLine’: common.h:280:27: warning: conversion from ‘int’ to ‘short int’ may change value [-Wconversion] #define castToShort(num) (inShortRange(num) ? (short int) (num) : (raise_error(RANGE_ERROR), (short int) 0)) ^ drw_x11.c:1546:22: note: in expansion of macro ‘castToShort’ points[0].x += castToShort(x); ^~~~~~~~~~~ common.h:280:27: warning: conversion from ‘int’ to ‘short int’ may change value [-Wconversion] #define castToShort(num) (inShortRange(num) ? (short int) (num) : (raise_error(RANGE_ERROR), (short int) 0)) ^ drw_x11.c:1547:22: note: in expansion of macro ‘castToShort’ points[0].y += castToShort(y); ^~~~~~~~~~~ drw_x11.c: In function ‘drwFPolyLine’: common.h:280:27: warning: conversion from ‘int’ to ‘short int’ may change value [-Wconversion] #define castToShort(num) (inShortRange(num) ? (short int) (num) : (raise_error(RANGE_ERROR), (short int) 0)) ^ drw_x11.c:1574:22: note: in expansion of macro ‘castToShort’ points[0].x += castToShort(x); ^~~~~~~~~~~ common.h:280:27: warning: conversion from ‘int’ to ‘short int’ may change value [-Wconversion] #define castToShort(num) (inShortRange(num) ? (short int) (num) : (raise_error(RANGE_ERROR), (short int) 0)) ^ drw_x11.c:1575:22: note: in expansion of macro ‘castToShort’ points[0].y += castToShort(y); ^~~~~~~~~~~ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o gkb_x11.o gkb_x11.c ar r ../bin/s7_draw.a gkb_rtl.o drw_x11.o gkb_x11.o ar: creating ../bin/s7_draw.a gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o kbd_rtl.o kbd_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o con_inf.o con_inf.c con_inf.c:387:12: warning: ‘inf_setfont’ defined but not used [-Wunused-function] static int inf_setfont (char *fontname) ^~~~~~~~~~~ con_inf.c:369:13: warning: ‘inf_standardcolour’ defined but not used [-Wunused-function] static void inf_standardcolour (void) ^~~~~~~~~~~~~~~~~~ con_inf.c:332:13: warning: ‘inf_beep’ defined but not used [-Wunused-function] static void inf_beep (void) ^~~~~~~~ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o kbd_poll.o kbd_poll.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o trm_inf.o trm_inf.c ar r ../bin/s7_con.a kbd_rtl.o con_inf.o kbd_poll.o trm_inf.o ar: creating ../bin/s7_con.a gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o arr_rtl.o arr_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o bln_rtl.o bln_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o bst_rtl.o bst_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o chr_rtl.o chr_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o cmd_rtl.o cmd_rtl.c cmd_rtl.c: In function ‘cmdSetFileMode’: cmd_rtl.c:3158:42: warning: conversion to ‘__mode_t’ {aka ‘unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion] chmod_result = os_chmod(os_path, int_mode); ^~~~~~~~ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o con_rtl.o con_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o dir_rtl.o dir_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o drw_rtl.o drw_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o fil_rtl.o fil_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o flt_rtl.o flt_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o hsh_rtl.o hsh_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o int_rtl.o int_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o itf_rtl.o itf_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o pcs_rtl.o pcs_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o set_rtl.o set_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o soc_rtl.o soc_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_rtl.o sql_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o str_rtl.o str_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o tim_rtl.o tim_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o ut8_rtl.o ut8_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o heaputl.o heaputl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o numutl.o numutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sigutl.o sigutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o striutl.o striutl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o big_rtl.o big_rtl.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o big_gmp.o big_gmp.c big_gmp.c: In function ‘bigHashCode’: big_gmp.c:906:90: warning: conversion to ‘mp_size_t’ {aka ‘long int’} from ‘size_t’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion] result = (intType) (mpz_getlimbn(big1, 0) << 5 ^ size << 3 ^ mpz_getlimbn(big1, size - 1)); ~~~~~^~~ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o cmd_unx.o cmd_unx.c cmd_unx.c: In function ‘getExecutablePath’: cmd_unx.c:92:23: warning: implicit declaration of function ‘readlink’; did you mean ‘cmdReadlink’? [-Wimplicit-function-declaration] readlink_result = readlink("/proc/self/exe", buffer, sizeof(buffer) - 1); ^~~~~~~~ cmdReadlink gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o dir_win.o dir_win.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o dll_unx.o dll_unx.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o fil_unx.o fil_unx.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o pcs_unx.o pcs_unx.c pcs_unx.c: In function ‘pcsPty’: pcs_unx.c:489:18: warning: implicit declaration of function ‘posix_openpt’; did you mean ‘os_popen’? [-Wimplicit-function-declaration] masterfd = posix_openpt(O_RDWR|O_NOCTTY); ^~~~~~~~~~~~ os_popen In file included from pcs_unx.c:35: pcs_unx.c:491:38: warning: implicit declaration of function ‘grantpt’ [-Wimplicit-function-declaration] if (unlikely(masterfd == -1 || grantpt(masterfd) == -1 || ^~~~~~~ version.h:82:39: note: in definition of macro ‘unlikely’ #define unlikely(x) __builtin_expect((x),0) ^ pcs_unx.c:492:20: warning: implicit declaration of function ‘unlockpt’; did you mean ‘unlink’? [-Wimplicit-function-declaration] unlockpt(masterfd) == -1 || ^~~~~~~~ version.h:82:39: note: in definition of macro ‘unlikely’ #define unlikely(x) __builtin_expect((x),0) ^ pcs_unx.c:493:35: warning: implicit declaration of function ‘ptsname’; did you mean ‘ttyname’? [-Wimplicit-function-declaration] (slavedevice = ptsname(masterfd)) == NULL)) { ^~~~~~~ version.h:82:39: note: in definition of macro ‘unlikely’ #define unlikely(x) __builtin_expect((x),0) ^ pcs_unx.c:493:33: warning: assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] (slavedevice = ptsname(masterfd)) == NULL)) { ^ version.h:82:39: note: in definition of macro ‘unlikely’ #define unlikely(x) __builtin_expect((x),0) ^ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o pol_unx.o pol_unx.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o soc_none.o soc_none.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_base.o sql_base.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_fire.o sql_fire.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_lite.o sql_lite.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_my.o sql_my.c gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_oci.o sql_oci.c sql_oci.c:1064:13: warning: ‘dumpSqltNumber’ defined but not used [-Wunused-function] static void dumpSqltNumber (memSizeType dataLen, const uint8Type *ociNumberData) ^~~~~~~~~~~~~~ sql_oci.c:1054:13: warning: ‘ociNumberFromDecimalInt’ defined but not used [-Wunused-function] static void ociNumberFromDecimalInt (OCINumber *ociNumber, const const_striType decimal, ^~~~~~~~~~~~~~~~~~~~~~~ sql_oci.c:910:12: warning: ‘ociNumberToDecimalFraction’ defined but not used [-Wunused-function] static int ociNumberToDecimalFraction (const OCINumber *ociNumber, striType stri, ^~~~~~~~~~~~~~~~~~~~~~~~~~ sql_oci.c:754:13: warning: ‘ociNumberToDecimalInt’ defined but not used [-Wunused-function] static void ociNumberToDecimalInt (const OCINumber *ociNumber, striType stri, ^~~~~~~~~~~~~~~~~~~~~ gcc -O2 -g -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -c -o sql_odbc.o sql_odbc.c sql_odbc.c: In function ‘connectToServer’: sql_odbc.c:5433:36: error: ‘SQL_DRIVER_NOPROMPT’ undeclared (first use in this function) SQL_DRIVER_NOPROMPT); ^~~~~~~~~~~~~~~~~~~ sql_odbc.c:5433:36: note: each undeclared identifier is reported only once for each function it appears in make: *** [<builtin>: sql_odbc.o] Error 1 Please note that I have been able to successfully compile seed7 in the past and have compiled the previous release - 2019-07-14 - without any issues. It compiles fine and all tests pass. If you require any further information, then please contact me, and I will endeavour to provide it. Brett. |
From: Thomas M. <tho...@gm...> - 2019-05-23 18:57:36
|
Hello Anton, many thanks for your bug report. Nothing is missing in your understanding. You discovered a test-case for generics, that was not used until now. The templates used in the Seed7 libraries don't need this use case. Nevertheless this case should work like other cases. I have just released a new version of Seed7: seed7_05_20190523.tgz With this version the bug is fixed. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. |
From: Anton L. <ant...@ur...> - 2019-05-20 01:17:54
|
Hi, I am trying to understand how generics in Seed7 work and after reading the FAQ section under "Are there generics/templates" my understanding is that a generic function should be able to accept other functions as generic parameters, however, when I compile the code below I am getting a segmentation fault, so what am I missing in my understanding? $ include "seed7_05.s7i"; const proc : GENERIC (in proc : procedure) is func begin const proc : run is func begin procedure; end func; end func; GENERIC (writeln ("Hello from Seed7!")); const proc : main is func begin run; end func; SEED7 COMPILER Version 3.0 Copyright (c) 1990-2019 Thomas Mertes Source: generic2.sd7 Compiling the program ... Segmentation fault Best, Anton |
From: Stéphane G. <ste...@wa...> - 2018-12-06 14:56:14
|
Hello, I would like to sort a table of rows, depending on the content of the second cell of a row. * A Row is an array of strings. * The table is an array of rows. * I want to sort table. * So I need to compare Rows. * So I thought I had to implement a compare() function that takes Rows as arguments and compares the specific string cell I desire. Here is the code I tried: ---------------------------- $ include "seed7_05.s7i"; include "stdio.s7i"; const type: Row is array string; const func integer: compare(in Row: A, in Row: B) is return compare(A[2], B[2]); const proc: main is func local var array Row : table is [] ( [] ("CCC", "BBB"), [] ("CCC", "AAA"), [] ("AAA", "CCC")); var Row : r is 2 times ""; begin for r range table do writeln(r[1] & " " & r[2]); end for; table:=sort(table); writeln("-----------"); for r range table do writeln(r[1] & " " & r[2]); end for; end func; ---------------------------- And it fails to compile, complaining that I redeclare the compare() function: ---------------------------- ~/test/seed7 $s7c compare_array.s7 SEED7 COMPILER Version 3.0 Copyright (c) 1990-2018 Thomas Mertes Source: compare_array.s7 Compiling the program ... *** compare_array.s7(8):34: (ref TEST_3 param, ref TEST_3 param) compare declared twice return compare(A[2], B[2]); -----------------------------------^ 1 error found ---------------------------- I imagine it has something to do with my Row type being not a true separate type, but rather some kind of alias to array? (I am knew to the language so I don't know if that even makes sense ;-) ) Anyway, what would be the right way(s) to achieve my goal? Faithfully yours, Stéphane Goujet. |
From: Joseph K. <joe...@gm...> - 2017-03-20 08:15:52
|
Hello there. I am looking at returinng to University to do a B.A Music or a B.Sc Computer Science (or both - I'm not sure yet). In order to get a headstart on the B.Sc, I read the syllabus and saw the introductory programming paper was a Python-based one, so I thought I'd have a go at writing some Python. I thought what would be easiest given that I haven't really programmed for 20 odd years was to find an existing bit of code and convert it. In a completely unrelated search, I found the Seed7 listing for the classic Star Trek game, and I thought that would be a fun thing to work with. To my satisfaction and mild surprise, I have got nearly all of it working and behaving like it should (I'm using the 'global' declaration in Python, which it seems would normally get me burnt at the stake, but for what I need, it works, so I'm at this point not too concerned). The only thing I can't quite get working is the movement / torpedo code, which according to what I have read, should just work. The Seed7 code: row := sectorRow; column := sectorColumn; x1 := flt(column) + 0.5; y1 := flt(row) + 0.5; angle := (course - 1.0) * 0.785398; delta_x := cos(angle); delta_y := -sin(angle); inquad := TRUE; blocked := FALSE; number := 1; while number <= distance do y1 := y1 + delta_y; x1 := x1 + delta_x; row := trunc(y1); column := trunc(x1); if column < 1 or column > 8 or row < 1 or row > 8 then inquad := FALSE; number := distance; else if sect[row][column] <> 1 then (* Object blocking move *) blocked := TRUE; number := distance; end if; end if; incr(number); and my code: num = 0 inQuad = False blocked = False x1 = 0.0 y1 = 0.0 row = 0 column = 0 angle = 0.0 deltaX = 0.0 deltaY = 0.0 row = sectorRow column = sectorColumn x1 = float(column) + 0.5 y1 = float(row) + 0.5 angle = (course - 1.0) * 0.785398 deltaX = math.cos(angle) deltaY = -math.sin(angle) inQuad = True blocked = False num = 1 while num <= distance: y1 += deltaY x1 += deltaX row = int(round(y1)) column = int(round(x1)) if column < 0 or column > 7 or row < 0 or row > 7: inQuad = False num = distance else: if sect[row][column] != 1: blocked = True num = distance num += 1 The sin and cos functions according to Seed7 and Python should output the same numbers, and I think the inputs are the same, but when I try to move, it doesn't correspond to what the help text says to expect. The only thing I can think of is I'm not using incr() at the end (I'm just going num += 1), and that's putting it all wrong, but I'm not sure. Can anybody who knows Seed7 and a bit of Python give me some advice? I'm just about there in terms of making it work, and this is the last real hurdle. Any help would greatly appreciated. Joseph Karl. |
From: Fernando R. <fer...@gm...> - 2016-05-27 07:16:06
|
I reply to the list, sorry for the duplicate email. Thank you very much for your response. > Hi, thank you for your interest in Seed7. > I am pleased to hear such a positive feedback. > Regarding your question. I am not an SQLite expert, but years ago I > did some > performance measurements with SQLite (not with Seed7 but with C++). > With the > measurements I found out that SQLite is much faster when it just works in > memory without a file. Opening an in memory SQLite database in Seed7 > is done with: > openDatabase(DB_SQLITE, "", "", "") Ok > The C interface of SQLite (and maybe also Tcl) uses the name > ":memory:" to open > an in memory database. So maybe your Tcl example works in memory while the > Seed7 example does not. The example was working in file :) > With short googling about SQLite autocommit I found this explanation: > https://www.sqlite.org/c3ref/get_autocommit.html > It seems that autocommit is on until you are inside a transaktion. > Transaktions are explained here: > http://www.tutorialspoint.com/sqlite/sqlite_transactions.htm > The commit function in the Seed7 driver for SQLite is currently a noop, so > commit(db) > will currently not work for a SQLite database but the following should > work: > execute(db, "BEGIN"); > execute(db, "COMMIT"); Yes, it works. From 5 seconds to 0.101 seconds. That's what I expected. Thanks. > Different databases have different behavior regarding commit and > transaktions. > So maybe Tcl always starts a transaktion without telling you. This > could be a way > to emulate that autocommit is switched off. If that works the Seed7 > interface > could do that also. I general I want to provide the same behavior for > all databases. > So it depends how the other databases handle autocommit and transactions. > I hope that I could help you. > Regards > Thomas Mertes > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > > > _______________________________________________ > Seed7-users mailing list > See...@li... > https://lists.sourceforge.net/lists/listinfo/seed7-users Cheers |
From: Thomas M. <tho...@gm...> - 2016-05-26 07:59:02
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hi, thank you for your interest in Seed7.</div> <div>I am pleased to hear such a positive feedback.</div> <div> </div> <div>Regarding your question. I am not an SQLite expert, but years ago I did some</div> <div>performance measurements with SQLite (not with Seed7 but with C++). With the</div> <div>measurements I found out that SQLite is much faster when it just works in</div> <div>memory without a file. Opening an in memory SQLite database in Seed7</div> <div>is done with:</div> <div> </div> <div> openDatabase(DB_SQLITE, "", "", "")</div> <div> </div> <div>The C interface of SQLite (and maybe also Tcl) uses the name ":memory:" to open</div> <div>an in memory database. So maybe your Tcl example works in memory while the</div> <div>Seed7 example does not.</div> <div> </div> <div>With short googling about SQLite autocommit I found this explanation:</div> <div>https://www.sqlite.org/c3ref/get_autocommit.html</div> <div>It seems that autocommit is on until you are inside a transaktion.</div> <div>Transaktions are explained here:</div> <div>http://www.tutorialspoint.com/sqlite/sqlite_transactions.htm</div> <div>The commit function in the Seed7 driver for SQLite is currently a noop, so</div> <div> </div> <div>commit(db)</div> <div> </div> <div>will currently not work for a SQLite database but the following should work:</div> <div>execute(db, "BEGIN");</div> <div>execute(db, "COMMIT");</div> <div> <div> </div> <div>Different databases have different behavior regarding commit and transaktions.</div> <div>So maybe Tcl always starts a transaktion without telling you. This could be a way</div> <div>to emulate that autocommit is switched off. If that works the Seed7 interface</div> <div>could do that also. I general I want to provide the same behavior for all databases.</div> <div>So it depends how the other databases handle autocommit and transactions.</div> <div> </div> <div>I hope that I could help you.</div> <div> </div> <div>Regards</div> <div>Thomas Mertes</div> </div> </div></div></body></html> |
From: FRD <fer...@gm...> - 2016-05-20 10:38:32
|
Hi, I'm new in the user's list. I've discovered Seed7 by accident browsing Rosetta Code's site. Now I'm doing small programs to understand the language. TL;DR My initial contact with the language is very positive. I like the syntax, very clear and regular, that makes programs very easy to read, but not as heavy to write as the Ada language (!). The use or result instead of return and the local block of variables make sense, it makes the code more structured. I like this feature in Eiffel language too. Multimethods are another good move. I'm interested in languages with this feature like Dylan or Common Lisp. Extension mecanism looks great, but I'm not ready yet to use it :). The documentation is good and the examples in prg directory are very interesting. Really impressive work. Congratulations. Now a question: I made a small program with SQLITE database. I notice that the insert time of a thousand records is more slow than I expected. The same program with Tcl doing only one transaction is 0.4s and with one transaction per insertion is 4s, the same time than the s7d program. It is possible to make a transaction with all the records together in Seed7? Is autocommit in SQLITE on? I didn't see nothing in the sql_base API to change it. my code is like db := open database prepare(statement) for record range records bind(parameters) execute(statement) end for commit(db) Kind regards, |
From: Arnel <jal...@gm...> - 2016-03-03 20:10:33
|
Hi Thomas, On Thu, 3 Mar 2016 10:56:16 +0100, "Thomas Mertes" <tho...@gm...> wrote: > Hi Arnel, > > I was able to install MSYS2 and gcc 5.3 from mingw64. > So I could test Seed7 with MSYS2 and gcc 5.3. > > In the latest release of Seed7 (2016-02-29) I fixed the error with > the floating point compare function. The other floating point error > (Sci operator for float with many digits does not work correct.) > does not show up. Maybe it was fixed in a previous Seed7 release. > Please update to the newest Seed7 release. With that no errors > should show up. If the tests still fail please tell me. That's great to hear. I already saw the new version a day or so ago, and confirmed there are no more errors. Thanks for the fix. > There is another issue with the MSYS2 console. Programs that want > to read single key presses without echo (e.g. kbd.sd7) do > not work. AFAIK this is a bug in the MSYS2 console (I found hints > for that by googling). The programs that have problems in the > MSYS2 console work without any problem in the windows console. > Just start kbd.sd7 in both consoles to see the difference. > In the windows console kbd.sd7 is terminated with ! and in the > MSYS2 console it must be terminated with CTRL-C (since it just > hangs). > > I found out that the function getch() (from conio.h) does cause > the hang up in the MSYS2 console. So the MSYS2 console should be > fixed or there should be special code in Seed7 to circumvent this > error. Maybe you have an idea. I also saw that, but unfortunately: (1) I'm not sure where to report that issue since the MSYS2 repository at Github appears to be related more to package management than the actual MSYS-2.0 project; (2) I've been on Linux (Ubuntu) for a week now, so I will probably spend less time on my Windows box to acclimatize myself to this new environment (Seed7 is already set up here anyway :)) At any rate, thank you for the quick response, and apologies for not being able to assist on the MSYS2 issue. ---- Thank you, Arnel |