BTW, the type bar is defined as typedef struct bar bar;
On Sunday, May 5, 2019 at 12:10:50 AM UTC+8, T L wrote: > > The FAQ, http://c-faq.com/aryptr/aryptrparam.html and > http://c-faq.com/aryptr/aryparmsize.html > says "bool foo(bar bars[2]);" <=> "bool foo(bar bars[]);" <=> bool > foo(bar* bars); > So I think if "bool foo(bar* bars);" compiles ok, then should also "bool > foo(bar bars[2]);. > > On Sunday, May 5, 2019 at 12:05:08 AM UTC+8, Jan Mercl wrote: >> >> On Sat, May 4, 2019 at 2:15 PM T L <tapi...@gmail.com> wrote: >> >> > But it is a pointer parameter, though it looks like an array. >> >> Yes, a pointer to an incomplete type. The compiler thus does not know >> how to compute address of bars[x] as that translates to bars + >> x*sizeof(bar). >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.