Skip to content

cdecl-18.0

Latest
Compare
Choose a tag to compare
@paul-j-lucas paul-j-lucas released this 05 Jul 23:01
· 156 commits to master since this release

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