Path: csiph.com!feeder.erje.net!2.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Thu, 10 Nov 2016 14:57:08 -0600 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Compiler design in C? References: <87shr14n5b.fsf@gmail.com> <87r36k1l4w.fsf@gmail.com> <3e47c9bc-1c0a-40dc-9dc3-92e88ace6c31@googlegroups.com> <87lgwrzvqt.fsf@gmail.com> <87lgwrdaiu.fsf@gmail.com> <87shqz7n08.fsf@gmail.com> <362fc76e-f4aa-4c66-abfd-ea4e8d87da47@googlegroups.com> Date: Thu, 10 Nov 2016 20:57:09 +0000 Message-ID: <87y40ruk7u.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:cILtZh/ImdbBF0yK8ku9mSE065U= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 15 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-XYFLgH3Xz0jyxUbZW6hLydc72cYFzH/hdK2aUb/LQXgAJKzPC+W/j5ZUM/hLssvzOfFcE1Zt6pGiisY!6Etc/ilvZWj7saUSXAf5/gaJs+Zo3QtBSPuJrR7gnnYLDRsfKQ9YOofy8CY+6OtxZnwL X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2131 Xref: csiph.com comp.lang.c:96334 jacobnavia writes: > Le 10/11/2016 à 11:58, gwowen a écrit : >> I can't. C doesn't support generics. > >> So I write a non-generic C++ function that calls the generic from the >> library. >> I have to write a one C function for sorting doubles, one for sorting >> ints, etc. > No. You can do it in C using the preprocessor. Yes you're right. I actually considered mentioning this, but decided against it.