Giter Club home page Giter Club logo

Comments (21)

boeckmann avatar boeckmann commented on August 26, 2024 2

already in sys.c I get this error in the following lines:

1488: bs = (struct bootsectortype *)&oldboot; 1614: bs = (struct bootsectortype *)&newboot; 1624: bs32 = (struct bootsectortype32 *)&newboot; 1784: bs32 = (struct bootsectortype32 *)&newboot;

That is, there are pointer conversion operations taking place in these parts of the sys.c code. The warning "W115: &array may not produce intended result" is triggered when you use the "&" operator on an array and do a pointer type conversion.

This was indeed fixed by @PerditionC via commit c152d55

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 2

tkchia, I gave an example, and definitely not a solution, as you can see, the variable I mentioned was an example, of an assumption, of a possible cause of error in the lines I mentioned, as you mentioned the 16-bit variable has the size from -32,768 to +32,767, unless you define a specific variable size, I gave a small example as a way of trying to understand the compilation error in the file, and again, I'm not a robot. I'm trying to help, I gave examples of how you can debug quickly, test it first, try to do the same, and you'll see what I'm talking about, however I ask you to stop trying to be a hater, that kind of thing only exists nowadays in the communities, one or the other trying to bank on the best, I've been testing and playing with the system for some time now, so please respect me, this is my hobby, not my profession. I hope you don't feel offended, hugs friend.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 1

Thanks for the compliment 🦾, but I can only test with other compilers after passing this compilation error, in fact something has changed, between version 2042 and 2043 OpenWatcom stopped compiling Kernel FreeDOS. If you try to debug you will have more success in getting the result. But it's hard for one person to do just that. If there was any way we could work this out together, I'd be happy. 🙂🤝

from kernel.

PerditionC avatar PerditionC commented on August 26, 2024 1

Please provide the exact error messages. It will tell which line causes your error and should say what the error is. Without this, adjusting the build/source to fix will be unlikely. Open Watcom is one of my primary compilers for the kernel, so it should work. Which version do you use? 1.9 and latest 2.0 git versions should work. Though my 2.0 git version is getting older, so maybe a recent change in the compiler found an error or introduced a new warning.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 1

First of all, I'm not a bot, okay? I'm a human friend, and I like old stuff, mostly FreeDOS for being open source, second MS-DOS for the new license and third not least OpenDOS which tried to be something like open source but stumbled on the license but still valid , but I still prefer FreeDOS in addition to programming, compiling, and debugging. I've been doing this for years alone, but now that I'm showing up here, it's necessary to share data, and that's important. After this, let's try to virtualize the sound, too bad the first attempt at this failed, and ended up hiding code and I didn't strictly follow the license, because all the projects used should benefit from the improved code.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 1

already in sys.c I get this error in the following lines:

1488: bs = (struct bootsectortype *)&oldboot;
1614: bs = (struct bootsectortype *)&newboot;
1624: bs32 = (struct bootsectortype32 *)&newboot;
1784: bs32 = (struct bootsectortype32 *)&newboot;


That is, there are pointer conversion operations taking place in these parts of the sys.c code. The warning "W115: &array may not produce intended result" is triggered when you use the "&" operator on an array and do a pointer type conversion.

These pointer conversions may be valid in certain contexts, but the warning is suggesting that there may be unexpected behavior when performing this conversion, possibly due to the type difference between the original variable and the target pointer.

So I removed the & and the error is gone, at least here... but dsk.c is still having problems as mentioned, or we can ignore the warning of a possible error and trample everything in the mkfile/watcom.mak file on lines 25 and 26 , and at the end of the command add -w0 which means I will be instructing the Watcom compiler not to issue warnings during compilation, but of course this is not recommended.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 1

I'll help you debug in DOSBOX, everything will be easier for any project you do, and you want to develop something.

1º Install DOSBOX.

2º Create a folder in C:\ of your disk, or in the folder /home/name/ in your linux called DOS. Inside the DOS folder create two more separate folders called C, and the other E.

3º Inside the "C" folder create a file called DOSBOX.BAT

4º Add the following lines to the DOSBOX.BAT file:


@echo OFF

SET TZ=EDT

C:

MOUNT E "C:\DOS\E"

If it's Linux do:


@echo OFF

SET TZ=EDT

C:

MOUNT E "\home\nameofuser\DOS\E"

5º Edit the file dosbox-0.74-3.conf in windows C:\Users\NameOfUser\AppData\Local\DOSBox, in Linux it is in the home folder if I'm not mistaken in .dosbox in the conf folder, and add it at the end of the file. conf the following lines:


@mount C "C:\DOS\C" -FREESIZE 1024
@if EXIST C:\DOSBOX.BAT CALL C:\DOSBOX.BAT
@if EXIST C:\AUTOEXEC.BAT CALL C:\AUTOEXEC.BAT

on linux it would look like this:


@mount C "\home\nameofuser\DOS\C" -FREESIZE 1024
@if EXIST C:\DOSBOX.BAT CALL C:\DOSBOX.BAT
@if EXIST C:\AUTOEXEC.BAT CALL C:\AUTOEXEC.BAT

note: put the cpu cycles from auto to MAX for, to make things faster...

6º Now download and extract the entire system using 7zip or any other into the folder C:\DOS\E or on Linux \home\nameofuser\DOS\E the "LITE" image of freedos.

7º open the dosbox and enter the E folder, with the command that we know... and execute the installation with the SETUP command and do the total installation of freedos.

8º Done, now just install the compilers.

9º Or of course do everything on a real machine using freedos on a usbstick.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 1

Look, I don't know, we need to stop and analyze it, it's okay there are other compilers, but we can't let it go, we should analyze it better, the problem is that I'm just having time today, and because I'm off today , but it's not demeaning but every compiler that can compile freedos is important, OW is no different. It's been a while since I've worked on projects, the last one is Haiku. And I'm not a robot as mentioned by tkchia 😂.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024 1

With regard to truncation, apart from short and the others as I mentioned earlier. But related to this one I will give an example.
Suppose you have a variable called age declared as an unsigned int. This variable is used to store a person's age.


unsigned int age = 300;

Now, imagine that you want to convert this age to an int (integer) data type. However, an int has a smaller range of possible values ​​compared to an unsigned int. An int can store values ​​from -32768 to 32767 (assuming a 16-bit int).


int convertedage = age;

In that case, a truncation error will occur. The age value, 300, exceeds the allowable range for an int. Truncation happens when the value is converted and only the most significant bits that fit in the int are kept, discarding the additional bits that represent the surplus part.
Therefore, the compiler will issue a warning of the type "Constant out of range - truncated", indicating that the conversion will result in a truncation, and will also provide additional information about the type of conversion involved.
It is important to be aware of these errors and be careful when converting between data types to avoid missing important information or unexpected behavior in the code.
It's good here, we'll talk. Until later. 👍

from kernel.

tkchia avatar tkchia commented on August 26, 2024 1

Hello Mr. (?) Anderson,

Erm, you still seem like a bot to me, and I claim my £5. Or, at the very least, you are trying your darnedest best to look and sound like a bot.

For one thing, I am sure the value 300 can fit very comfortably in a 16-bit signed int variable. As you yourself pointed out, int has a range of -32,768 to +32,767.

I am not (yet) sure what exactly you are up to. But I suppose we will find out soon.

Thank you!

from kernel.

tkchia avatar tkchia commented on August 26, 2024

Hmm. Spoken like a true bot (IMO).

from kernel.

PerditionC avatar PerditionC commented on August 26, 2024

I'm just looking for the error message or at least where the build failed for you, otherwise I don't know where to even start looking for your build issue. Note that building often works on one OS and fails on others. :-( What OS are you building on? DOS, Win9x, NT pre6, NT6+, Linux,...?

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024

So let's go, there are two files that the compilation does not pass with OpenWatcom 1.9 or 2.0, it simply manages to compile normally with the commercial version Watcom 10.6 and 11.0, which is beside the point. So when compiling OW 2.0 I get this error about dsk.c, DSK.log:

dsk.c(176): Warning! W106: Constant out of range - truncated
dsk.c(176): Note! I2003: source conversion type is 'unsigned int'
dsk.c(176): Note! I2004: target conversion type is 'int'
dsk.c(179): Warning! W106: Constant out of range - truncated
dsk.c(179): Note! I2003: source conversion type is 'unsigned int'
dsk.c(179): Note! I2004: target conversion type is 'int'
dsk.c(468): Warning! W106: Constant out of range - truncated
dsk.c(468): Note! I2003: source conversion type is 'unsigned int'
dsk.c(468): Note! I2004: target conversion type is 'short'
dsk.c(517): Warning! W106: Constant out of range - truncated
dsk.c(517): Note! I2003: source conversion type is 'unsigned int'
dsk.c(517): Note! I2004: target conversion type is 'short'
dsk.c(558): Warning! W106: Constant out of range - truncated
dsk.c(558): Note! I2003: source conversion type is 'unsigned int'
dsk.c(558): Note! I2004: target conversion type is 'short'
dsk.c(673): Warning! W106: Constant out of range - truncated
dsk.c(673): Note! I2003: source conversion type is 'unsigned int'
dsk.c(673): Note! I2004: target conversion type is 'short'
dsk.c(722): Warning! W106: Constant out of range - truncated
dsk.c(722): Note! I2003: source conversion type is 'unsigned int'
dsk.c(722): Note! I2004: target conversion type is 'short'
dsk.c(796): Warning! W106: Constant out of range - truncated
dsk.c(796): Note! I2003: source conversion type is 'unsigned int'
dsk.c(796): Note! I2004: target conversion type is 'short'
dsk.c(822): Warning! W106: Constant out of range - truncated
dsk.c(822): Note! I2003: source conversion type is 'unsigned int'
dsk.c(822): Note! I2004: target conversion type is 'short'
dsk.c(826): Warning! W106: Constant out of range - truncated
dsk.c(826): Note! I2003: source conversion type is 'unsigned int'
dsk.c(826): Note! I2004: target conversion type is 'short'
dsk.c(856): Warning! W106: Constant out of range - truncated
dsk.c(856): Note! I2003: source conversion type is 'unsigned int'
dsk.c(856): Note! I2004: target conversion type is 'short'
dsk.c(875): Warning! W106: Constant out of range - truncated
dsk.c(875): Note! I2003: source conversion type is 'unsigned int'
dsk.c(875): Note! I2004: target conversion type is 'short'
dsk.c(878): Warning! W106: Constant out of range - truncated
dsk.c(878): Note! I2003: source conversion type is 'unsigned int'
dsk.c(878): Note! I2004: target conversion type is 'short'
dsk.c(881): Warning! W106: Constant out of range - truncated
dsk.c(881): Note! I2003: source conversion type is 'unsigned int'
dsk.c(881): Note! I2004: target conversion type is 'short'
dsk.c(884): Warning! W106: Constant out of range - truncated
dsk.c(884): Note! I2003: source conversion type is 'unsigned int'
dsk.c(884): Note! I2004: target conversion type is 'short'
dsk.c(888): Warning! W106: Constant out of range - truncated
dsk.c(888): Note! I2003: source conversion type is 'unsigned int'
dsk.c(888): Note! I2004: target conversion type is 'short'
dsk.c(890): Warning! W106: Constant out of range - truncated
dsk.c(890): Note! I2003: source conversion type is 'unsigned int'
dsk.c(890): Note! I2004: target conversion type is 'short'
dsk.c(892): Warning! W106: Constant out of range - truncated
dsk.c(892): Note! I2003: source conversion type is 'unsigned int'
dsk.c(892): Note! I2004: target conversion type is 'short'
dsk.c(894): Warning! W106: Constant out of range - truncated
dsk.c(894): Note! I2003: source conversion type is 'unsigned int'
dsk.c(894): Note! I2004: target conversion type is 'short'
dsk.c(896): Warning! W106: Constant out of range - truncated
dsk.c(896): Note! I2003: source conversion type is 'unsigned int'
dsk.c(896): Note! I2004: target conversion type is 'short'


These warning messages indicate that type conversions have occurred where a constant of type unsigned int was truncated (that is, had its high-order bits discarded) when being converted to an int or short type. The specific W106 warning message is issued by the Watcom compiler and usually indicates that a data loss occurred during the conversion.

For example, consider the following code snippet:

unsigned int x = 50000;
int y = x;

In this case, the constant 50000 is of type unsigned int, which is an unsigned type that can store values ​​greater than zero. However, when assigning this value to a variable of type int, which is a signed type and has a smaller range, truncation occurs, resulting in a loss of data.

These warnings are issued to warn of the possibility of data loss during conversion. It's important to review these conversions and consider whether the loss of data is acceptable or whether you need to make any code modifications to avoid potential issues.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024

It doesn't matter if I'm using the virtualbox system, and windows, or Linux, or natively... I've tested them all, and it still gives errors.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024

I hope you can follow me... I can help you debug faster using dosbox instead.

from kernel.

boeckmann avatar boeckmann commented on August 26, 2024

@4nd3r50ncr is it essential for you to compile 2043? Otherwise you might try to compile the master branch. Perhaps there are fixes beyond the one posted above.

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024

is it essential for you to compile 2043? Otherwise you might try to compile the master branch. Perhaps there are fixes beyond the one posted above.

Wanting to get away from the errors, I'm running the branch too.

from kernel.

tkchia avatar tkchia commented on August 26, 2024

Hello Mr. (?) Anderson,

I still do not know what you are up to. But it seems that whatever it is you are doing, you are doing it wrong.

I gave a small example as a way of trying to understand the compilation error in the file, and again, I'm not a robot.

Cutting-and-pasting a (wrong) "explanation" of an error message from what is obviously an AI model — and passing it off as your own "understanding" — is a dumb idea. If you do not understand why, then we cannot help you.

Thank you!

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024

No offense, but you're being an idiot, and you haven't even tried to reproduce the compilation error I'm getting, I'm using DOSBOX as my emulation area and that's perfect for me, what I wrote was on the uncopied finger, or you don't did you understand? I'll tell you exactly what it is, it's been a couple of years or so since I haven't been able to compile with OW, or are you offended that you're not using your 16-bit gcc compiler? I think I'm lay? I will try to solve the problem myself. Thanks, and don't bug me.

from kernel.

tkchia avatar tkchia commented on August 26, 2024

Hello Mr. (?) Anderson,

Duuude.

Thank you!

from kernel.

4nd3r50ncr avatar 4nd3r50ncr commented on August 26, 2024

I love you HATER, that's why the community is divided, unfortunately, kisses and hugs

from kernel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.