FLTK logo

Re: [fltk.coredev] Re: How to test C++98 compatibility?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: How to test C++98 compatibility? Albrecht Schlosser 12:33 May 09  
 
On 5/8/23 15:58 'melcher....@googlemail.com' via fltk.coredev wrote:
Ok, so I used https://godbolt.org (awesome!) to compile with any meaningful compiler down to Spark, Webassembly, ESP32, and llvm for Commodore C46. Lowest gcc available is 4.8.5.

Every dev should bookmark this (I did already). In some questionable areas this might be useful.

MSVC does not go low at all. The code does compile a test macro on each and every one of them. Only if I set `-std=c++98` and pedantic, I will get an error: anonymous variadic macros were introduced in C99. 

... as expected with '-pdantic'.

Not sure if that is acceptable.

This kind of callbacks is a new feature. If someone insists on using ancient compilers they should not use this **new** feature. That's it.

IMHO acceptable, yes.

I can of course rewrite this to use a trailing number for number of arguments... : `FL_FUNCTION_CALLBACK_3(btn, something, int, a, 3, int, b, 4, int, c, 5)`

This would be an interesting change because it would make sure that you assign the correct number of arguments (triplets) for every macro. Should be considered, IMHO. Even better if it also increases compatibility...

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/1b2ee2ec-edd9-f420-4177-a0bafaec52c9%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.