From: Peter Korsgaard Date: Thu, 11 Oct 2018 14:46:53 +0200 Subject: [Buildroot] Analysis results for 2018-10-09 In-Reply-To: <87k1molnar.fsf@tkos.co.il> (Baruch Siach's message of "Thu, 11 Oct 2018 14:45:16 +0300") 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> <87k1molnar.fsf@tkos.co.il> Message-ID: <87r2gw1whu.fsf@dell.be.48ers.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net >>>>> "Baruch" == Baruch Siach writes: > 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. Ehh, yes - But I was talking about the typedef line (as quoted above). The * is needed for typedef but not for the val_in definition. -- Bye, Peter Korsgaard