Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[C] Incorrect error indication when a function return type is on the line before the function name and struct/enum types are used

Open simonbates opened this issue 4 years ago • 2 comments

  • Sublime Version: 3211
  • OS Version: Ubuntu 20.04
enum foo {
	SOME_VAL
};

struct bar {
};

enum foo
baz(struct bar *a)
{
	return SOME_VAL;
}

Screenshot from 2021-03-29 14-57-41

This code compiles without error with GCC:

gcc -c sublime_text_test.c

simonbates avatar Mar 29 '21 19:03 simonbates

This is possible to handle as of ST4 and requires quite a bunch of syntax rework to make it use the new branching feature to overcome line blindness. A prototype how to handle those situations can be found in #2654.

deathaxe avatar Apr 01 '21 19:04 deathaxe

Similar to C++ namespace function with struct return values: (notice the italic font of baz and Bar:: should be in green)

image

davidhcefx avatar Apr 15 '21 13:04 davidhcefx