From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baruch Siach Date: Thu, 11 Oct 2018 14:45:16 +0300 Subject: [Buildroot] Analysis results for 2018-10-09 In-Reply-To: <875zy8spe0.fsf@dell.be.48ers.dk> References: <20181010060010.4E3C920736@mail.bootlin.com> <20181010174814.5ac114f1@windsurf> <87y3b5ks97.fsf@tkos.co.il> <87a7nksr18.fsf@dell.be.48ers.dk> <87o9c0lozx.fsf@tkos.co.il> <875zy8spe0.fsf@dell.be.48ers.dk> Message-ID: <87k1molnar.fsf@tkos.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hi Peter, Peter Korsgaard writes: >>>>>> "Baruch" == Baruch Siach writes: > >> -typedef double hbase_f(double); > >> +typedef double (*hbase_f)(double); > > > Wouldn't that make the definition 'hbase_f *val_in' a pointer to > > function pointer? > > Not in C at least. The syntax is: > > typedef (*name)() > > https://stackoverflow.com/questions/1591361/understanding-typedefs-for-function-pointers-in-c Correct. But consider the SO example code: typedef void (*SignalHandler)(int signum); extern SignalHandler signal(int signum, SignalHandler handler); The 'handler' parameter of the signal() function is a pointer to a function. However the definition SignalHandler *handler; would create a pointer to a pointer. As I understand, this is not the intention of the 'hbase_f *val_in' definition in the original code. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -