(This post contains some reflections on the hypothetical design of an ideal programming language...)
Don't use or support the use of preprocessing source code. Preprocessing means that all the tools which operate on the source code (including editors, compilers, static analyzers, etc.) will necessarily need to either support preprocessing themselves, or call the preprocessor before operating on the resultant source code.
Consider, for example, a simple tool that parses C code and searches for a given text in all the literal strings found in that code. If the source code needs to be preprocessed, then certain parts of the code may not be searched if the part in question is contained within the equivalent of a C-preprocessor #ifdef/#endif block. On the other hand, if we want our tool to also find strings inside these sections, then we can no longer use a C parser because #ifdef and #endif are not recognized by the C parser proper.
(The solution to the problem might include using regular expressions as a kind of heuristic to determine where the strings are, and then do concatenations, etc. However, this is only an approximate solution, and is in general not entirely satisfying. What about the more complex task of looking for specific variable or function declarations? In fact, a number of such tools have had to deal with variations of this problem; see for example LXR and Coccinelle.)
Multiple, different types of preprocessors also don't mix very well. For example, as an extension to many programming languages, the source code is preprocessed so that SQL queries are substituted with the (possibly verbose) support code which would otherwise be needed to prepare and execute the query in question. Now we have exactly the same problem as mentioned above, which is that support tools (editors, compilers, etc.) will have to either support the preprocessor language or (more likely) always operate on already-preprocessed source code, with all the aforementioned drawbacks. In some cases, the order of preprocessing will also become significant, or different preprocessor languages might be incompatible.
Another practical aspect of preprocessing is that the code which is inside such #ifdef blocks will be compiled only conditionally; the compiler might not even look at it. This means that the compiler is a lot less useful than it could be. It is one of the main tasks of the compiler to inform the programmer when he/she is writing something which is internally inconsistent, such as calling a function with the wrong argument types. (This is entirely possible if there is a caller of the function inside an #ifdef block and the definition of the function was later changed to take different arguments.)
In conclusion, I think C/C++ could have done a lot better in this area. On the other hand, a lot of other programming languages did get it right. But maybe the need for alternative compilation is greater in the lower-level languages and it's really just a trade-off between performance and usability.
Intelligence View
⚡ tsecurity.de Intelligence
Notes on source code preprocessing
(This post contains some reflections on the hypothetical design of an ideal programming language...)Don't use or support the use of preprocessing source code.…
Powered by tsecurity.de
tsecurity.de Hub
Security Briefing Ücretsiz · Tek tıkla abonelikten çıkma
Zeka Digest - ücretsiz
Günlük en önemli güvenlik haberi · herhangi bir zamanda alınabilir
Community Rating & Social Proof
⭐ Okuyucu Puanı
–
Ø / 5.0
★★★★★
Hiçbir okuyucu henüz yorum yok
Bu makale yararlı mıydı?
0
Powered by tsecurity.de
tsecurity.de Hub
İlgili Story Cluster & Kaynaklar (vector AI)
6 Cluster
İlgili Story Cluster & Kaynaklar (vector AI)
28 Kaynaklar
GOG Black Friday sale is live, plus multiple Lara Croft games enter the GOG Preservation Program
GamingOnLinux Latest Articles 42 dakika önce
27 diğer kaynaklar
LLatest from TechRadar57 dakika önceBlack Friday Sonos: the best deals on wireless speakers, soundbars and more LLatest from TechRadar52 dakika önceBlack Friday discounts on Seagate's Expansion Desktop Hard Drive make it one of the cheapest of its kind, with discounts of up to 22% on higher storage capacities LLatest from TechRadar48 dakika önceThe best Black Friday Philips Hue deals: save on smart bulbs, string lights, and light strips LLatest from TechRadar46 dakika önceNewegg knocks $348 off its AMD Ryzen 7 5800X3D PC bundle for Black Friday LLatest from TechRadar44 dakika önceThe best early Black Friday Garmin deals, picked by a smartwatch tester LLatest from TechRadar35 dakika önceWork like it's 1998: Aura Displays' retro-inspired Bondi Blue Triple Aero ’98 Pro Max laptop screen extender gets a 16% discount for Black Friday LLatest from TechRadar34 dakika önceThe Disney+ and Hulu Black Friday streaming deal for just $5 has returned GGolem.de44 dakika önceAnzeige: Beliebter WLAN-Repeater für nur 23,32 Euro im Black Friday Angebot AAndroid55 dakika önceBose Black Friday: Diese Kopfhörer, Soundbars und Boxen sind heute reduziert LLatest from TechRadar1 saat önceBlack Friday phone deals: 35 hand-picked deals on Apple iPhones, Pixels, Samsung phones, and more PPC-WELT1 saat önceBlack Friday: Saugroboter von Dyson, Roborock und Mova heute zum Amazon-Tiefstpreis PPC-WELT1 saat önceBlack Friday: Saugroboter von Dyson, Roborock und Mova heute zum Amazon-Tiefstpreis LLatest from TechRadar1 saat önceApple's lightweight 2026 M5 MacBook Air gets $250 off for Black Friday EEngadget1 saat önceFive solar generators going for deep discounts on Black Friday TThe Verge1 saat önceXteink’s pocketable X4 Classic e-reader is down to just $55 for Black Friday PPC-WELT1 saat önceMein liebstes Produktivitäts-Gadget: Stream Deck zum Black Friday günstiger PPC-WELT1 saat önceApple Mac mini wird immer günstiger: Diese Mini-PCs sind im Black-Friday-Sale PPC-WELT1 saat önceMein liebstes Produktivitäts-Gadget: Stream Deck zum Black Friday günstiger CCodrops2 gün önceBlack Friday 2026: 10 Deals for Web Designers and Front-End Developers CCNET12 gün önceSave $112 on Sony’s Flagship WH-1000XM6 Headphones This Black Friday CCNET1 saat önceSave $56 on Baseus Inspire XC1 Open Earbuds With This Black Friday Deal GGolem.de1 saat önceAnzeige: Ankers Soundcore-Lautsprecher zum Black Friday für 18 Euro bei Amazon PPC-WELT2 saat önceBlack Friday: MacBook, Surface & Co. jetzt bis zu 630 Euro günstiger LLatest from TechRadar2 saat önceThousands of Black Friday deals are live right now. These are the 175 best LLatest from Windows Central2 saat önceXBOX 25th anniversary hardware has a perfect companion for mobile gaming — and it's 20% off for Black Friday PPC-WELT2 saat önceDas beste Tool, das ich je für unter 14 Euro gekauft habe – jetzt als Black-Friday-Schnäppchen CCNET2 saat önceShop Top Apple Watch Black Friday Deals, Starting at $179
5 Kaynaklar
CVE-2026-68466 | Linux Kernel up to 7.2-rc3 lpc32xx_slc lpc32xx_slc.c lpc32xx_xmit_dma return value (WID-SEC-2026-2852)
VulDB Updates 1 saat önce
4 diğer kaynaklar
VVulDB Updates1 saat önceCVE-2026-68455 | Linux Kernel up to 7.1.4 liveupdate kex.c luo_session_ioctl input validation (WID-SEC-2026-2852) VVulDB Updates1 saat önceCVE-2026-68456 | Linux Kernel up to 7.2-rc2 ueagle-atm wait_for_completion race condition (WID-SEC-2026-2852) VVulDB Updates1 saat önceCVE-2026-68457 | Linux Kernel up to 7.1.4 ksmbd permission (WID-SEC-2026-2852) VVulDB Updates1 saat önceCVE-2026-68458 | Linux Kernel up to 6.18.39/7.1.4/7.2-rc2 binder binder_transaction buffer overflow (WID-SEC-2026-2852)
4 Kaynaklar
Drupal Fail2Install (CVE-2026-132165): Active Attacks & Fix
IT Security News 29 dakika önce
3 diğer kaynaklar
4 Kaynaklar
Microsoft ruft „Code Red“ aus: Outlook-Ausfall hat Konsequenzen
ifun.de 45 dakika önce
3 diğer kaynaklar
GGolem.de1 saat önceOutlook, Onedrive und Co.: Nach Ausfall herrscht bei Microsoft Alarmstufe Rot LLatest from TechRadar1 saat önceMicrosoft declared an internal 'Code Red' after historic M365 outage, notes 'our work doesn't end when service is restored' GGoogle Alert4 saat önceMicrosoft ruft nach 24-Stunden-Ausfall „Code Red“ aus - it-daily.net
3 Kaynaklar
Twilio's New 10DLC Rejection Codes (Dec 2026): What Each Means and How to Avoid Paying for a Rejection
DEV Community 32 dakika önce
3 Kaynaklar
CVE-2026-112317 | Red Hat Enterprise Linux 1.2.8 lib/kdb lib/kdb/keytab.c krb5_ktkdb_get_entry memory leak (Nessus ID 385886)
VulDB Updates 1 saat önce
2 diğer kaynaklar
VVulDB Updates1 saat önceCVE-2026-112318 | Red Hat Enterprise Linux/Hardened Images 1.5.3 Policy RPC Stubs server_stubs.c xdr_nullstring null pointer dereference (Nessus ID 385886) VVulDB Updates1 saat önceCVE-2026-119079 | Red Hat Enterprise Linux/Hardened Images ASN.1 asn1_encode.c decode_sequence_of denial of service (Nessus ID 385886)
Mehr aus dieser Kategorie
Blättern: Pfeiltasten [ ← ] [ → ] · Tasten j / k · mobil: Wischen
HAND-OFF
Auf Smartphone übergeben (ADVISORY)
Scannen Sie den QR-Code mit der Smartphone-Kamera für sofortigen mobilen Zugriff:
https://tsecurity.de/tr/3501006/unix-ve-linux-sunucular/notes-on-source-code-preprocessing/
💬 Topluluk tartışması ve yorumlar
Tartışmayı başlat: Social Chat yayın akışı veya yukarıdaki ekleme formuyla uzman katkısı gönder.