Ossama,
Regarding designated initializers; simply ?yes?. Regarding the compiler selection; the limiting factor is the validation effort which involves: 1) Finding the maximum compiler (C and C++) versions that is available for all of the supported platforms (for instance, iOS, Android and Arduino all have their commonly available compilers which may not be the most current) 2) Validating the code under the new target compiler 3) Making it official which includes getting everybody bumped to the new baseline toolset. 4) Optionally, Clean up atavistic compiler constructs and workarounds. This can happen, opportunistically, in the long tail. It is just leg work. So I just need someone to do the leg work and make the case. That said, I am still encouraging that developers use the language features in which a preponderance of the developers are fluent. Code need to be clear. In most (not all) cases, clarity is more important than performance/size/etc. So the use of advanced language features will be discouraged if most developers cannot follow it. I hope that this makes sense. Pat From: iotivity-dev-bounces at lists.iotivity.org [mailto:[email protected]] On Behalf Of Othman, Ossama Sent: Wednesday, March 11, 2015 4:09 PM To: Jon A. Cruz Cc: iotivity-dev at lists.iotivity.org Subject: Re: [dev] Minimum compiler versions Hi, On Wed, Mar 11, 2015 at 11:14 AM, Jon A. Cruz <jonc at osg.samsung.com <mailto:jonc at osg.samsung.com> > wrote: There appears to be version requirements on compilers missing from the wiki. It is actually something very helpful to keep visible, and can keep developers from falling into various problems. As a bare minimum I can see that the project requires C99 for C compilation, Regarding C99 features, I'd like to see IoTivity use designated initializers <https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html> in its C code far more than it already is to provide cleaner ways to initialize structures. The paradigm where a memset() is used to zero out the structure and then initialize individual fields used in many places throughout IoTivity is obviated by designated initializers. The only compilers that I'm aware of that don't support this 15 year old feature are versions of Visual Studio older than 2012. and g++ with the c++11 standard flag enabled for C++. For the C++ features, we should end up listing *which* C++11 features we want to use and which we want to avoid. Various versions of different compilers are missing some features, and have buggy implementations of others. So what are the details on our minimum required compiler versions? For GCC, the documented <https://www.iotivity.org/documentation/linux/getting-started> minimum is 4.6.1. However, that compiler is fairly old (released 27 June 2011 <https://gcc.gnu.org/gcc-4.6/> ). It'd be nice to go straight to the latest stable GCC 4.9.2, but assuming that's too big a jump for some I'd like to at least see a jump to GCC 4.7.1 as the minimum version since it addresses quite a few C++11 issues relative to the 4.6 series. I've seen arguments that 4.6 is being held on to as the minimum for legacy platform and code backward compatibility. Given that IoTivity is still relatively new and undergoing change, it's not clear why backward compatibility specific to code is an issue. Furthermore, supporting old platforms that have buggy or incomplete support for C/C++ language features used in IoTivity seems like a bad idea. Is there any chance we make 4.7.1 the minimum required version of GCC for IoTivity? Thanks, -Ossama -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150311/573be170/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7198 bytes Desc: not available URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150311/573be170/attachment.p7s>
