What happens with VARARGS68k in 4.4.5/latest SDK ?
  • Butterfly
    Butterfly
    kas1e
    Posts: 97 from 2005/10/31
    Trying to build such simple test case which works fine on morphos's gcc 2.x , but not on latest 4.4.5 gcc:

    Code:

    #define VARARGS68K __attribute__((varargs68k))
    void VARARGS68K lsprintf(char *, char *, ...);

    int main()
    {};


    Quote:


    # ppc-morphos-gcc -noixemul 1.c -o 1
    1.c:2: warning: 'varargs68k' attribute directive ignored



    I do check on includes, and find out that directive is still somewhere present: gg/include/ix.h have such a line:

    Quote:


    int ix_req(char *title, char *button1, char *button2, char *fmt, ...) __attribute__((varargs68k));



    So for sake of tests i even try that test_case:

    Code:

    int ix_req(char *title, char *button1, char *button2, char *fmt, ...) __attribute__((varargs68k));

    int main()
    {};


    And :

    Quote:


    # ppc-morphos-gcc -noixemul 1.c -o 1
    1.c:1: warning: 'varargs68k' attribute directive ignored



    Question is: wtf ? How to make it works ? And its not just harmless warnings, the code which rely on varargs68k attribute do not works as well on new gcc (but works on old one, like gcc2.x)

    [ Edited by kas1e 17.04.2013 - 11:36 ]
  • »17.04.13 - 09:00
    Profile
  • Butterfly
    Butterfly
    munk
    Posts: 94 from 2006/3/27
    Quote:

    1.c:2: warning: 'varargs68k' attribute directive ignored

    The GCC4-port for MorphOs does not support this attribute. I have no idea why its not available with this port. So if you need it, then you have to use GCC2.
  • »18.04.13 - 10:40
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3108 from 2003/3/5
    From: Canada
    Use GCC 2.95.3 if you need varargs68k. GCC 4 is not intended for legacy stuff.
  • »18.04.13 - 17:13
    Profile Visit Website
  • Butterfly
    Butterfly
    kas1e
    Posts: 97 from 2005/10/31
    @jacadcaps
    Did you mean gcc 4 on morphos ? Because for example os4 version of gcc which i use, 4.4.3, for sure have that attribute (dunno why if gcc4 not intended for, maybe they add workarounds for)

    Anyway, it seems that its better to never use that VARARGS68K stuff and rewrite it all the time to make all compilers happy, and code in end will looks better.
  • »19.04.13 - 04:29
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3108 from 2003/3/5
    From: Canada
    This is something you have to add to gcc yourself when making a MorphOS or AmigaOS or whatever build. We chose not to.
  • »19.04.13 - 05:10
    Profile Visit Website
  • Butterfly
    Butterfly
    kas1e
    Posts: 97 from 2005/10/31
    @jacadcaps

    Quote:


    We chose not to.



    But what about that morphos_reference.pdf in which one of parts related to those VARARGS68K, their usage, how ABOX works with them and so on. For example http://www.ggsdata.se/Pegasos/Bilder/morphos_reference.pdf , there 2.1.3 Variable Arguments and some pages about. Can confuse devs imho
  • »19.04.13 - 08:05
    Profile
  • MorphOS Developer
    zukow
    Posts: 645 from 2005/2/9
    From: Poland
    please, give reference to some document from official archives/webpages
  • »19.04.13 - 09:26
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3108 from 2003/3/5
    From: Canada
    The document you quoted is from 2002...
  • »19.04.13 - 15:21
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    So what? SYS:Docs/MorphOS-dev.pdf of 3.9 is not marked as obsolete IMHO.
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »22.10.15 - 13:34
    Profile
  • Moderator
    Kronos
    Posts: 2323 from 2003/2/24
    But it should still be obvious that a quirk named ???????68k ain't the latest tech when it comes to developing for MorphOS.
  • »22.10.15 - 14:13
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    How about this: the TeX source of the PDF is lost, so noone can make any updates - just guessing.
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »23.10.15 - 18:42
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Sprocki
    Posts: 128 from 2005/2/23
    From: Berlin - Germany
    Copy and paste from the PDF works quite well. You have to reformat it, though. Otherwise use https://en.wikipedia.org/wiki/Pdftotext .
  • »23.10.15 - 22:18
    Profile
  • Butterfly
    Butterfly
    munk
    Posts: 94 from 2006/3/27
    Quote:

    Kronos wrote:
    But it should still be obvious that a quirk named ???????68k ain't the latest tech when it comes to developing for MorphOS.

    FWIW, the varargs68k attribute is documented and used to be supported. As long as the MorphOs compiler is GCC based I would expect support for (all) extensions present added to GCC2.

    If there is real interest, I could provide the missing bits for varargs68k support for whatever GCC version wanted. I have the plan to offer updated GCC versions with all options and extensions available on GCC2. However, there is no time frame and I still more focused on m68k.
  • »28.10.15 - 13:43
    Profile
  • Moderator
    Kronos
    Posts: 2323 from 2003/2/24
    Quote:

    munk wrote:


    FWIW, the varargs68k attribute is documented and used to be supported.


    Same could be said for K&R-styled parameter passing or any other relic from the 70s....

    If someone was planning to remove varargs68k from GCC2.x you'd have a valid argument, but with GCC4 which is only interesting for those that want to use "bleeding edge" C(++) revisions it just makes no sense to support 20++ year old kludges designed for systems that have limited relevance to the target architecture.



    [ Edited by Kronos 28.10.2015 - 16:25 ]
  • »28.10.15 - 14:24
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    VARARGS68K was neat extension 15 years ago when porting 68k code but it is not used in new code anywhere. It is better use __VA_ARGS__ extension or find another solution, like using standard vararg conventions.
    1 + 1 = 3 with very large values of 1
  • »28.10.15 - 16:46
    Profile
  • Butterfly
    Butterfly
    munk
    Posts: 94 from 2006/3/27
    Quote:

    Kronos wrote:
    Quote:

    munk wrote:
    FWIW, the varargs68k attribute is documented and used to be supported.

    Same could be said for K&R-styled parameter passing or any other relic from the 70s....

    Recently I build GCC 2.95.x which is written in K&R with clang 3.4 on a FreeBSD 10/amd64 host as a 64bit executable and the build process was rather painless. Of course, patches were needed to have a successful and usable build result but that was not related to the code style but simply bugs when using a 64bit host system.

    Quote:

    If someone was planning to remove varargs68k from GCC2.x you'd have a valid argument, but with GCC4 which is only interesting for those that want to use "bleeding edge" C(++) revisions it just makes no sense to support 20++ year old kludges designed for systems that have limited relevance to the target architecture.

    I assumed that GCC3+ was not used to build modern C++ code only. Different users have different use cases, other people could use those (missing) features. And not being able to use newer compiler versions is then disappointing.

    I understand that the MorphOs team has more urgent needs than implementing these features. I know very well how painful maintaining GCC patches is thus I wrote that I have varargs68k addition for newer GCC versions. That code is the MOS code from its 2.95 compiler but adapted for the changed sources thus those functions do have its morphos name part still present. I used this for stuff for my custom PowerUp GCC port.
  • »09.11.15 - 09:08
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Do you intend to support baserel and GCC 4?
    1 + 1 = 3 with very large values of 1
  • »09.11.15 - 12:29
    Profile
  • Butterfly
    Butterfly
    munk
    Posts: 94 from 2006/3/27
    Quote:

    itix wrote:
    Do you intend to support baserel and GCC 4?

    Yes. Do you have any specific GCC version in mind?
  • »10.11.15 - 21:04
    Profile