Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Compiling C project for Windows and Mac OS X (GCC for Linux) |
| Date | 2015-09-16 13:26 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <mtbjhd$ula$1@dont-email.me> (permalink) |
| References | (2 earlier) <mtb0eh$ulf$1@dont-email.me> <mtb3ug$8ul$1@dont-email.me> <6dd2d227-fd27-4616-b1a5-049c7e3c37cb@googlegroups.com> <mtbc58$4j4$1@dont-email.me> <mtbiio$p08$1@speranza.aioe.org> |
On 16/09/15 13:08, Morten W. Petersen wrote: > On 16.09.2015 11:20, David Brown wrote: >> On 16/09/15 11:03, Malcolm McLean wrote: >>> On Wednesday, September 16, 2015 at 8:00:27 AM UTC+1, David Brown wrote: >>>> >>>> This can be summed up with: >>>> >>>> Use a modern C or C++ standard. Write valid code. >>>> Use appropriate headers for your vector functions. >>>> Don't use weird Apple-only extensions to gcc. >>>> In fact, don't use Apple's weird Objective-C at all. >>>> >>> A modern C++ standard is fine. >>> If you're writing in C, you must use a conservative subset of C89. >>> Otherwise it will break on Microsoft compilers. >> >> The issue here was for compatibility between clang and gcc. >> >> But if you need compatibility with MS's feeble offerings in C, then yes, >> you need to pick a limited version of C90 or C89, and have a set of >> wrappers for library functions that MS implements in a different way or >> has declared to be "unsafe" and therefore not immediately available. >> But the code will be compatible between gcc and clang - the issues there >> are with things like subtle changes to the meaning of "inline" (with the >> default -std setting), which is not an issue with C89/C90 code. > > So MS doesn't support standards here either? > MSVC does not support C standards properly beyond something like C90. AFAIUI, it has recently gained more C99 support, but basically it is a C++ compiler and not a C compiler, as far as MS is concerned. Other C compilers on Windows should be okay - gcc, clang, icc, etc. So it is all a matter of how portable you need to be, and how many different tools you want to support. > Anyway, the reason I was thinking of supporting different compilers and > IDEs is to make the code accessible, for review, changes, integration / > compiler-specific optimization and so on. Aim to make your code a simple set of headers and C files with a clear structure. Have a header file that handles compatibility, using #ifdef's for automatic compiler detection to deal with the incompatibilities - it should be good enough for most purposes, along with basic requirements (such as C99 support). And have a readme with instructions, and a simple Makefile that works using the system's default compiler and adds required flags (such as for setting the C standard), which should work out of the box for gcc or clang, on most *nix systems, including Windows with msys/mingw or cygwin. Then users of IDE's or other compilers should have no problem importing the code into a project on that system, and you don't have to deal with the messy details. > > The project looks like it will be available under the LGPL so any > changes to the library has to be sent back upstream, making for > better code. It also looks like it will be forwards-compatible C90 > code. Be careful that using the LGPL also means that any user's code linked with it also has to be under the GPL/LGPL unless they build your library as a DLL/SO, or mess about with distributing object files if they want to use static linking. So if your intention is to let people use your code freely for static linking but force changes and improvements in /your/ files to be made public, then the LGPL is not the answer. You are better with the Mozilla Public License or an explicitly modified GPL/LGPL that makes your position clear. (See www.freertos.org for an example of a modified GPL.) > > Another good thing about making it accessible is that the code will > be compiled on different compilers. I think that will also make bugs > pop up that show that the code needs to be corrected because the > programmer hasn't understood C90 properly. > > -Morten >
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 06:18 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-16 17:06 +1200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 08:00 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 09:00 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 02:03 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 11:20 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 13:08 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 13:26 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 17:47 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 09:37 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 15:41 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-17 07:06 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 16:22 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 23:13 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 15:35 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-16 18:12 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 13:18 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 08:47 -0700
Re: Quoting Noob <root@127.0.0.1> - 2015-09-16 20:30 +0200
Re: Quoting Keith Thompson <kst-u@mib.org> - 2015-09-16 11:41 -0700
Re: Quoting Noob <root@127.0.0.1> - 2015-09-16 20:53 +0200
Re: Quoting Keith Thompson <kst-u@mib.org> - 2015-09-16 12:19 -0700
Re: Quoting Noob <root@127.0.0.1> - 2015-09-16 21:49 +0200
Re: Quoting Keith Thompson <kst-u@mib.org> - 2015-09-16 13:24 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-16 18:14 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 18:22 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-16 18:29 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 18:31 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 12:48 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 18:56 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 13:09 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 23:41 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 18:05 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Martin Shobe <martin.shobe@yahoo.com> - 2015-09-16 12:13 -0500
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 10:13 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) fir <profesor.fir@gmail.com> - 2015-09-16 14:01 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 10:02 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) fir <profesor.fir@gmail.com> - 2015-09-16 13:53 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) fir <profesor.fir@gmail.com> - 2015-09-16 14:10 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 10:33 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 19:40 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Martin Shobe <martin.shobe@yahoo.com> - 2015-09-16 12:50 -0500
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 19:55 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 13:57 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 11:02 -0700
Re: Hidden agendas on Usenet Noob <root@127.0.0.1> - 2015-09-16 20:50 +0200
Re: Hidden agendas on Usenet Keith Thompson <kst-u@mib.org> - 2015-09-16 12:20 -0700
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 23:33 +0200
Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-16 17:52 -0400
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 00:03 +0200
Re: Hidden agendas on Usenet Keith Thompson <kst-u@mib.org> - 2015-09-16 15:21 -0700
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 00:30 +0200
Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 00:26 +0100
Re: Hidden agendas on Usenet Geoff <geoff@invalid.invalid> - 2015-09-16 21:24 -0700
Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 05:48 +0100
Re: Hidden agendas on Usenet Geoff <geoff@invalid.invalid> - 2015-09-17 07:16 -0700
Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 17:00 +0100
Re: Hidden agendas on Usenet Keith Thompson <kst-u@mib.org> - 2015-09-17 11:23 -0700
MSVC deprecation (was Re: Hidden agendas on Usenet) Keith Thompson <kst-u@mib.org> - 2015-09-16 23:31 -0700
Re: MSVC deprecation (was Re: Hidden agendas on Usenet) Geoff <geoff@invalid.invalid> - 2015-09-17 07:33 -0700
Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 11:46 +0200
Re: Hidden agendas on Usenet Ian Collins <ian-news@hotmail.com> - 2015-09-17 22:26 +1200
Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 11:17 +0000
Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 13:33 +0200
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 13:56 +0200
Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 14:20 +0200
Re: Hidden agendas on Usenet Bartc <bc@freeuk.com> - 2015-09-17 13:28 +0100
Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 15:18 +0200
Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 13:34 +0000
Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 12:29 +0000
Re: Hidden agendas on Usenet Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-17 05:34 -0700
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 14:48 +0200
Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-17 08:52 -0400
Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-17 08:50 -0400
Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 12:57 +0000
Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 13:52 +0100
Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-17 07:13 -0700
Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-17 07:42 -0700
Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-17 07:55 -0700
Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-18 05:51 -0700
Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-16 16:27 -0400
Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-16 23:35 +0200
Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 00:36 +0100
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 08:09 +0200
Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 07:59 +0100
Re: Hidden agendas on Usenet Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-17 01:13 -0700
Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 13:08 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 23:22 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Damon <Richard@Damon-Family.org> - 2015-09-17 08:57 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-17 15:28 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-17 09:45 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Damon <Richard@Damon-Family.org> - 2015-09-17 22:56 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-18 10:19 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Robert Wessel <robertwessel2@yahoo.com> - 2015-09-17 23:01 -0500
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-18 10:20 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Heathfield <rjh@cpax.org.uk> - 2015-09-18 09:23 +0100
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-18 14:08 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-18 08:48 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Lowell Gilbert <lgusenet@be-well.ilk.org> - 2015-09-18 16:44 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-18 17:33 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Lowell Gilbert <lgusenet@be-well.ilk.org> - 2015-09-19 21:12 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-09-21 09:10 +0000
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-21 09:16 +0000
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 08:34 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 09:33 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 10:43 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 12:29 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 13:10 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 13:42 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 14:04 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 14:34 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 15:01 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Damon <Richard@Damon-Family.org> - 2015-09-16 22:26 -0400
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-17 13:46 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 12:48 +0100
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Philip Lantz <prl@canterey.us> - 2015-09-19 12:40 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-09-21 09:14 +0000
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-21 06:13 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-21 17:39 +0100
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-10-02 13:21 +0000
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-10-02 13:25 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-10-04 13:51 +0000
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-10-04 15:45 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Geoff <geoff@invalid.invalid> - 2015-09-16 21:39 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 00:42 +0100
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Kelsey Bjarnason <kbjarnason@gmail.com> - 2015-09-24 07:34 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Robert Wessel <robertwessel2@yahoo.com> - 2015-09-16 23:55 -0500
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Robert Wessel <robertwessel2@yahoo.com> - 2015-09-16 13:03 -0500
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-16 19:31 +1200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 11:06 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-16 21:17 +1200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 11:56 +0200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 08:59 -0700
Re: "gcc" on OS X Noob <root@127.0.0.1> - 2015-09-16 21:43 +0200
Re: "gcc" on OS X Keith Thompson <kst-u@mib.org> - 2015-09-16 13:20 -0700
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-17 08:25 +1200
Re: Compiling C project for Windows and Mac OS X (GCC for Linux) gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 11:21 +0000
Re: gcc not a symlink on Mac OS X Noob <root@127.0.0.1> - 2015-09-17 17:06 +0200
csiph-web