Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
47 user(s) are online (35 user(s) are browsing Forums)

Members: 2
Guests: 45

Amigafreak02, jarokuczi, more...

Support us!

Headlines

 
  Register To Post  

« 1 2 (3) 4 »
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
Compiled some of my programs.

For someones, a lot of new warnings, great !

I fixed the majority except a strange one regarding SliderObject/IntegerObject.

Is somebody knows why my IntegerObject complains ?
(if I comment ICA_TARGET, no more complaint but of course my 2 objects are no more linked)

Thanks

windows.h:5031:66: warning: operation on 'Objects[93]' may be undefined [-Wsequence-point]
LAYOUT_AddChild, OBJ(OBJ_BACKPREFS_TRANS_INTEGER) = IntegerObject,
^

LAYOUT_AddChild, OBJ(OBJ_BACKPREFS_TRANS_INTEGER) = IntegerObject,
GA_ID, OBJ_BACKPREFS_TRANS_INTEGER,
GA_RelVerify, TRUE,
GA_TabCycle, TRUE,
INTEGER_MaxChars, 3,
INTEGER_Minimum, 0,
INTEGER_Maximum, 255,
INTEGER_Number, TRANSPARENT_LEVEL,
INTEGER_SkipVal, 1,
End, // Integer

LAYOUT_AddChild, OBJ(OBJ_BACKPREFS_TRANS_SLIDER) = SliderObject,
GA_ID, OBJ_BACKPREFS_TRANS_SLIDER,
GA_RelVerify, TRUE,
SLIDER_Min, 0,
SLIDER_Max, 255,
SLIDER_Level, TRANSPARENT_LEVEL,
SLIDER_KnobDelta, 10,
SLIDER_Orientation, SLIDER_HORIZONTAL,
SLIDER_Ticks, 21,
SLIDER_ShortTicks, TRUE,
ICA_TARGET, OBJ(OBJ_BACKPREFS_TRANS_INTEGER),
ICA_MAP, slider,
End, // Slider


Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
What happens if earlier you initialize all Objects:
Object *Objects[GID_LAST] = { 0 };
or just the one showing warning:
OBJ(OBJ_BACKPREFS_TRANS_INTEGER) = { 0 };

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@jabirulo

Not better by initializing it but thank you ;)

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@zzd10h

Does it help if you add parenthesis around the assignment?

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@salass00

Thank you, I don't know, I fixed it by commenting ICA_TARGET during slider object creation and by adding a SetGadgetAttrs(slider...,ICA_TARGET,integer,...) it after window creation.

edit : not better with ()

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@zzd10h

I see the problem now, you are assigning and then using OBJ(OBJ_BACKPREFS_TRANS_INTEGER) in another place in the same statement.

This can lead to undefined behavior depending on the compiler (depending on which part it decides to execute first).

Using SetGadgetAttrs() as you did gets rid of the issue.

http://stackoverflow.com/questions/41 ... avior-and-sequence-points

BTW since ICA_TARGET doesn't change the gadget look you can just use the regular SetAttrs(). Also if the window pointer is NULL then SetGadgetAttrs() is the same as a call to SetAttrs().

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@salass00
Right, thx, SetAttrs works well too.

Regarding the undefined behavior, strangely the SDK example GUI/Integer does the same ICA_TARGET assignment and when I compile it with gcc 5.3.0, no warning.

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@zzd10h

Quote:

Regarding the undefined behavior, strangely the SDK example GUI/Integer does the same ICA_TARGET assignment and when I compile it with gcc 5.3.0, no warning.


If the ICA_TARGET is in a "higher" layout than the assignment then maybe the compiler has no choice but to do the right thing.

At least that would be my guess without seeing the source code in question. Either that or you forgot to specify -Wall when compiling it.

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
"or you forgot to specify -Wall when compiling it."
Ah yes, I forgot it. Stupid me !

Now even SDK example complains :
IntegerExample.c: In function 'make_window':
IntegerExample.c:88:61: warning: operation on 'Objects[0]' may be undefined [-Wsequence-point]
LAYOUT_AddChild, OBJ(OBJ_INTEGER_1) = IntegerObject,
^

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@Raziel
Quote:
Oh and be sure to delete "cp" from the gcc install, use the older one instead

I've also discovered the "rm" command in the new coreutils won't work with wildcards if you compile from an Amiga shell. The "rm" command does work with wildcards if you compile from an "sh" shell.

The old "rm" in the current SDK will work with wildcards from an Amiga shell and an "sh" shell. With the new "rm": "rm *.o" works from an "sh" shell but not from an Amiga shell.

If you have a "clean" target in your makefile that calls "rm *.o" your sources may not actually get cleaned unless you are using an "sh" shell.


Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Updated Gnu compiler?
Quite a regular
Quite a regular


See User information
@xenic

Is that gmake or make? Or are they one and same in the current SDK? I have installed it but I have not looked into it.

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@Thematic
It might work with gmake but the point is that it doesn't work like the SDK 'rm' and could potentially create problems for someone no aware of that fact.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Updated Gnu compiler?
Not too shy to talk
Not too shy to talk


See User information
@xenic,
seems that wildcards doesnt work not for rm
but probabily with every shell commands, I generally use ls
because i am used with it on unix machines and wildcards
are not working

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@xenic

Does those new CP/RM work if you enable in DOS Prefs 'enable * wildcard' option?

(just a 2nd workaround/fix, instead of replacing with "old" CP/RM)

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
Ooops, sorry double post.

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@jabirulo
Quote:
Does those new CP/RM work if you enable in DOS Prefs 'enable * wildcard' option?


You could have tried it yourself in less time that it took to write your post but no it doesn't help. I still get the error message:

cannot lstat `*.o': No such file or directory

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
Will there be a new release?

Go to top
Re: Updated Gnu compiler?
Home away from home
Home away from home


See User information

Go to top
Re: Updated Gnu compiler?
Just can't stay away
Just can't stay away


See User information
@Raziel
Quote:
I guess you've already seen that?

Actually, there appears to be GCC 6 sources available with the sba1/adtools project at github. I can't access the sources because the Python scripts won't work with OS4 Python and there may also be problems with OS4 sgit. Possibly someone running Linux or Cygnix could get the sources and compile them.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Updated Gnu compiler?
Home away from home
Home away from home


See User information
What is most interesting for me at moment, is that i read there and there (for example in some versins of apps zz10dh do, as well as that problem with compiling latest RadeonHD drivers), that gcc5 produce some problems, while compiling same code with 4.x give us no problems.

Was it somehow discrovered what problem is and fixed ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 2 (3) 4 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project