How do I understand complicated function declarations?

As others have pointed out, cdecl is the right tool for the job.

If you want to understand that kind of declaration without help from cdecl, try reading from the inside out and right to left

Taking one random example from your list char (*(*X[3])())[5];
Start at X, which is the identifier being declared/defined (and the innermost identifier):

char (*(*X[3])())[5];
         ^

X is

X[3]
 ^^^

X is an array of 3

(*X[3])
 ^                /* the parenthesis group the sub-expression */

X is an array of 3 pointers to

(*X[3])()
       ^^

X is an array of 3 pointers to function accepting an unspecified (but fixed) number of arguments

(*(*X[3])())
 ^                   /* more grouping parenthesis */

X is an array of 3 pointers to function accepting an unspecified (but fixed) number of arguments and returning a pointer

(*(*X[3])())[5]
            ^^^

X is an array of 3 pointers to function accepting an unspecified (but fixed) number of arguments and returning a pointer to an array of 5

char (*(*X[3])())[5];
^^^^                ^

X is an array of 3 pointers to function accepting an unspecified (but fixed) number of arguments and returning a pointer to an array of 5 char.


Read it out from the inside, similar to how you would solve equations such as {3+5*[2+3*(x+6*2)]}=0 - you'd start by solving what's inside () then [] and finally {}:

char (*(*x())[])()
         ^

This means that x is something.

char (*(*x())[])()
          ^^

x is a function.

char (*(*x())[])()
        ^

x returns a pointer to something.

char (*(*x())[])()
       ^    ^^^

x returns a pointer to an array.

char (*(*x())[])()
      ^

x returns a pointer to an array of pointers.

char (*(*x())[])()
     ^         ^^^

x returns a pointer to an array of pointers to functions

char (*(*x())[])()
^^^^

Meaning the array pointer returned by x points to an array of function pointers that point to functions that return a char.

But yeah, use cdecl. I used it myself to check my answer :).

If this is still confusing you (and it probably should), try to do the same thing on a piece of paper or in your favorite text editor. There's no way of knowing what it means just by looking at it.