Skip to content

Releases: paul-j-lucas/cdecl

cdecl-18.0

05 Jul 23:01
Compare
Choose a tag to compare

Allowing blocks & user-defined literals in multi-declarations
Apple blocks and C++ user-defined literals are now correctly allowed in multi-declarations, e.g.:

int i, a[2], (^b)(char), f(double), operator~(S&), operator""_x(char)

cast & declare command executable name support
Support for the cast & declare command as the executable name has been dropped; only the explain command is still supported. (I didn't realize until now that declare conflicts with the shell built-in.)`

Cast to typedef
Casting to a typedefd type is fixed:

cdecl> typedef int T
cdecl> cast x into T
(T)x

C99 language extensions
Fixed printing of C99 language extention names.

CDECL_DEBUG environment variable
If set to an "affirmative" value (one of 1, t, true, y, or yes, case-insensitive), then cdecl will print its process ID and a "waiting for debugger to attach" message to standard error and wait indefinitely for a debugger to attach.

CDECL_TEST environment variable
If set to an "affirmative" value (one of 1, t, true, y, or yes, case-insensitive), then cdecl be in "testing mode" (see man page for details).

complex & imaginary help
Adding these missing modifiers to the help.

Constructor & pre-C99 function qualifiers
const, volatile, __restrict, final, and override qualifiers are now syntactically allowed on constructors and pre-c99 functions even though they are still semantically illegal to give better error messages.

Digraph & trigraph preprocessor support
Digraphs & trigraphs are now supported by the preprocessor:

#define   ML ??/
  multiline

%:define  QD(X)  %:X          // same as: #define QD(X) #X
??=define QT(X)  ??=X         // same as: #define QT(X) #X

Additionally when showing macros in either digraph or trigraph mode, the correct tokens are used:

cdecl> set digraphs
cdecl> show QD
%:define QD(X) %:X

Digraph & trigraph structured binding support
Digraphs & trigraphs are now correctly supported for structured bindings.

--echo-commands & config files
Commands are now also echoed for those in configuration files.

infer-command and constant cast
When infer-command mode is set, spelling out constant now works correctly:

constant cast p into pointer to int

File line number
When reading from a file via -f, now includes the file name and error line number in error messages.

Fixed multi-declaration of functions
A multi-declaration of functions with different signatures has been fixed, e.g.:

cdecl> explain int f(int), g(double)
declare f as function (integer) returning integer
declare g as function (double precision) returning integer

Invalid conf file is now fatal
An error in a conf file is now fatal.

New --lineno, -L option
Specifies an integer to add to all line numbers in error and warning messages as a debugging aid. (See the man page for details.)

show non-existent glob
An error message will now be printed if a glob has no matches.

More permissive scope
Now, scope can be used anywhere in a scoped declaration, i.e., something having the generic scope can have anything nest within it and scope can nest within anything.

C++ std namespace
Whenver "std" is used for a scope, cdecl now automatically makes it a namespace, e.g.:

c++decl> struct std::T
c++decl> explain std::T x
declare x as structure T of namespace std

Using predefined macro names elsewhere
Attempting to use a predefined macro name as an ordinary name now results in an error:

cdecl> explain int __DATE__
               ^
9: error: "__DATE__" is a predefined macro

cdecl-17.0.1

18 Jun 13:23
Compare
Choose a tag to compare

Fixed returning parameter packs
Functions returning parameter packs is now correctly illegal.

cdecl-17.0

13 Jun 15:54
Compare
Choose a tag to compare

Abbreviated function template parameter packs
Functions with auto parameters (abbreviated function templates) like:

int f( auto x )

have been supported since cdecl 9.6; this release adds additional support for parameter packs like:

int f( auto ...x )

Added help option suggestions
Added suggestions to error messages for the help options commands, english, and options, for example:

cdecl> help eglish
            ^
6: "eglish": no such command or option; did you mean "english"?

Constrained auto
For abbreviated function templates, constrained auto declarations are now supported:

c++decl> explain C auto x
declare x as concept C
c++decl> explain C auto ...x
declare x as concept C parameter pack

auto parameters in typedefs
Use of auto in typedef function-like parameters is now correctly reported as an error:

c++decl> typedef int F(auto)
                       ^
15: error: "auto" illegal in type definition

decltype declarations
Now recognizing decltype just to say it's not supported.

Glob help
The help text now defines "glob."

GNU --version
Now printing cdecl copyright year, author, license, free software statement, and no warranty statement to conform to the GNU Coding Standards; see https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html.

Structured binding declarations
Structured binding declarations are now supported except that you don't assign them from anything (no = expression):

c++decl> explain auto [x, y]
declare x, y as structured binding
c++decl> explain auto&& [x, y]
declare x, y as rvalue reference to structured binding

Fixed operator declaration core dump
An invalid scoped operator name containing a keyword like:

c++decl> explain bool int::operator!()

would dump core; fixed.

Fixed --west-decl=t for pointer to const pointer
Given:

c++decl --west-decl=t 'declare p as pointer to const pointer to int'

you'd incorrectly get:

int *const *p;

You now correctly get:

int* const* p;

cdecl-16.4.1

28 May 12:53
Compare
Choose a tag to compare

Fixed make install DESTDIR=...
Fixed make install of shell completion functions when setting DESTDIR on the command-line.

Better error message when expanding __VA_* macros
Attempting to expand either __VA_ARGS__ or __VA_OPT__ now says that either is valid only in a macro definition.

cdecl-16.4

25 May 15:08
Compare
Choose a tag to compare

Echoing commands short option
The short option for --echo-commands has been changed from -O to -E.

Number help
Help now includes what a "number" is.

Shell completion options
There are two new options: --commands/-K that prints cdecl's commands for the current language and --options/-O that prints cdecl's options. Both are intended to aid in writing shell completion functions for cdecl.

Shell completion functions
Bash and Zsh shell completion functions for cdecl are included under share and are installed as part of make install.

Improved error messages for predefined types
Improved error messages in cases involving a predefined type such as:

cdecl> explain int int8_t
cdecl> struct int8_t

In both cases, the error message printed now is:

error: "int8_t" is a predefined type starting in C99

cdecl-16.3

16 Apr 13:28
Compare
Choose a tag to compare

Better destructor parameter error message
Attempting either to explain or declare a destructor having a parameter list now prints "destructors may not have parameters" explicitly.

Defining a type more than once
If a type is defined again where the current language is older than the language in which it was previously defined, the type's set of languages is now updated to be the current language and newer. For example, previously:

cdecl> set c23
cdecl> typedef int Int
cdecl> show
typedef int Int;
cdecl> set c17
cdecl> typedef int Int        // Already exists so did nothing.
cdecl> show                   // Would NOT show anything.
cdecl>

Now the second typedef would update Int to make it available in C17 and newer so the second show would show it.

Multiple conflicting declarations
Now exhaustively checking multiple declarations for conflicts in C. Previously, multiple declarations of a variable or function with conflicting types that was separated by a different variable or function wasn't caught:

int x, x;                     // OK in C
int x, *x;                    // error (different types)
int x, y, *x;                 // error, but wasn't caught

Now it is.

Using macros elsewhere
Previously, attempting to use a macro where names are generally allowed would result in an error like:

cdecl> #define N 5
cdecl> explain int a[N]
                     ^
15: syntax error: "N": ']' expected

because "N" was returned as a macro token by the lexer. Now, the lexer ignores the fact that a name might be a macro.

cdecl-16.2.2

29 Feb 15:32
Compare
Choose a tag to compare

long long not until C++11
Previously, cdecl allowed long long in C++98 and C++03, but it wasn't officially supported until C++11. Now, cdecl allows long long in C++ only since C++11.

cdecl-16.2.1

20 Feb 13:52
Compare
Choose a tag to compare

Fixed macro argument list memory leak
Fixed said leak.

cdecl-16.2

30 Jan 02:49
Compare
Choose a tag to compare

Partial typeof support
Both typeof and typeof_unqual in C23 are partially supported in that types are accepted (but expressions are not):

typeof(int*) x                // supported
typeof(x) y                   // not supported

Additionally, GNU's __typeof__ is a synonym for typeof.

cdecl-16.1

14 Jan 16:20
Compare
Choose a tag to compare

explicit-ecsu in English
The value of the explicit-ecsu option now also applies in pseudo-English. Previously:

c++decl> class C
c++decl> explain C *p
declare p as pointer to C

Now (with explicit-ecsu containing c):

c++decl> class C
c++decl> set explicit-ecsu = csu
c++decl> explain C *p
declare p as pointer to class C

Leading/trailing whitespace stringification
Previously:

#define Q2(A,B,C)  #B
expand Q2(, a b ,)

incorrectly returned " a b " whereas now it correctly returns "a b".