On Feb 9, 12:35 am, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> > I suspect there's no way to do any of this, but I thought I'd ask before
> > I took a more...cumbersome route. Oh, also what is this declaration
> > structure:
> > 2038 static void
> > 2039 list_func_vars(first)
> > 2040 int *first;
> > 2041 {
> > 2042 if (current_funccal != NULL)
> > 2043 list_hashtable_vars(&current_funccal->l_vars.dv_hashtab,
> > 2044 (char_u *)"l:", FALSE, first);
> > 2045 }
>
> > I've never seen that in C before. Declaring variables after the
> > arguments but before the body?
>
> > --Whaledawg
>
> It's not variables, it's the arguments: "int *first" here means that
> "first", the argument, is a pointer to int. I'm told doing it this way
> rather than "static void list_func_vars(int *first)" makes the source
> more portable among various C compilers.
>
> IIUC, the Vim C source obeys the C89 standard, as shown by this line
> which I see in the logfile where I saved the stdout/stderr of configure:
>
> checking for gcc option to accept ISO C89... none needed

not exactly "obeys" - Vim is relying on C89 to use pre-standard
syntax.
That's called "legacy C", and iirc is not supported in the current
standard.

Besides that drawback, using legacy C provides less stringent type-
checking
and other compiler diagnostics.

It was for that reason that I phased out my own use of legacy C ten
years ago.

(of course, if your program has no bugs, you don't need compiler
checking -
but I've never seen an interesting program without bugs)

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui