4D Blog

Home Product Customize Global Warnings Generation

Customize Global Warnings Generation

July 19, 2024

Product

Warnings are a valuable aid for alerting 4D developers to potential code mistakes. With the release of 4D 20 R6, it is now possible to globally define which warnings are generated, enhancing the overall development experience.

Warnings generated by the Compiler and the Live Syntax Checker are crucial for avoiding code errors. They serve as an early alert system, notifying developers of code likely to cause execution errors. This is particularly useful in scenarios such as using pointers, where compilation cannot verify the type of a pointed variable, or dealing with implicit variable type casts.

Tailoring Warnings to Your Project

Depending on the size and complexity of the project, a large number of warnings may be generated. Although these warnings do not prevent compilation, they can sometimes be overwhelming, making it harder for developers to focus on the most critical issues. Recognizing this, many developers have expressed a desire to customize the warning codes generated, and displayed in the Compiler dialog box and code editors.

Introducing Global Warning Definitions

We’ve listened to these developers, and with 4D 20 R6, they can define the warnings they want to be generated globally.
A new tab has been added to the Compiler page of the project Structure Settings dialog box. This tab contains a list of all available warnings. Only warnings checked in the list will be generated globally, in the compiler dialog, and in the code editors (4D code editor and VS Code).

Even if a warning type is generated or not according to the parameters set, it is still possible to activate and deactivate the checking of a warning type locally in the code using the legacy //%W+ and //%W- switches.

By default, all warning types are enabled, reflecting our belief in their value as crucial aids for developers. However, we understand that each project has unique requirements, so you have the power to show or hide specific warnings to suit your needs.

NEW OPTION FOR COMPILE PROJECT COMMAND

The Compile project command returns a list of warnings encountered during compilation. By default, the command takes into account the warnings defined in the Structure Settings, and returns the same list as the one displayed in the Compiler dialog box.
But you can now impact this list using a warnings collection in the options parameter of the command.

Take a look at this code example in which all warnings except #518.1 and #518.2 will be returned in the $warnings collection:

var $options:={warnings: []}
$options.warnings.push({major: 518; minor: 1; enabled: False})
$options.warnings.push({major: 518; minor: 2; enabled: False})
var $result:=Compile project($options)
var $warnings:=$result.errors.query("isError = :1"; False)

Your feedback matters

We strive to provide our users with the best possible experience, and we encourage you to share your thoughts and comments on the 4D forum. Your feedback helps us understand your needs and continually improve our products and services.
Happy coding!

Discuss

Tags 20 R6, 21, Code editor, Compiler

Latest related posts

  • January 20, 2026

    4D AI: Sorting Query Results by Vector Similarity

  • January 20, 2026

    Better Error Handling and Type Inference for 4D Developers

  • January 9, 2026

    Session handling in 4D Qodly Pro

Avatar
Damien Fuzeau
- Product Owner - Damien Fuzeau joined the 4D Product team in February 2019. As a Product Owner, he is responsible for writing user stories and translating them into functional specifications. His role also involves ensuring that the delivered feature implementations meet customer needs. Damien holds a degree in Software Engineering from the University of Nantes. He spent over 23 years at his previous company, first as a developer (discovering 4D in 1997), and later as Engineering Manager and Software Architect. The company was an OEM partner of 4D and deployed enterprise software based on 4D for thousands of users across hundreds of servers. Damien is therefore well-versed in 4D development and deployment in multilingual environments.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D-Analyzer 4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy