Click here to Skip to main content
15,886,199 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: What is your language feature wish list? Pin
Cpichols2-Feb-23 1:33
Cpichols2-Feb-23 1:33 
GeneralRe: What is your language feature wish list? Pin
Jeremy Falcon2-Feb-23 6:44
professionalJeremy Falcon2-Feb-23 6:44 
AnswerRe: What is your language feature wish list? Pin
trønderen2-Feb-23 4:06
trønderen2-Feb-23 4:06 
AnswerRe: What is your language feature wish list? Pin
BernardIE53172-Feb-23 6:32
BernardIE53172-Feb-23 6:32 
GeneralRe: What is your language feature wish list? Pin
trønderen2-Feb-23 12:00
trønderen2-Feb-23 12:00 
AnswerRe: What is your language feature wish list? Pin
Member 133016792-Feb-23 9:02
Member 133016792-Feb-23 9:02 
AnswerRe: What is your language feature wish list? Pin
englebart2-Feb-23 14:35
professionalenglebart2-Feb-23 14:35 
AnswerRe: What is your language feature wish list? Pin
Chad3F3-Feb-23 10:00
Chad3F3-Feb-23 10:00 
C:
- A standard (and simple) way to declare a parameter (or local variable) as not-nullable. Clang supports such an extension, as does gcc (but in a less clean way). It would be better to have a portable tag to do it defined in the language standards. Honestly, this should have been done in back in C99, and would have probably stopped many bugs over the last decade or two.

- Variable value bound declarations. So if a parameter is declared unsigned int, but really only has a meaningful range of 0-100, it could flag it during compile time that it is an error. Probably more useful to set reasonable bounds on items which could cause integer overflows (or static buffer overflows when still used due to legacy code).. For example:
typedef struct
{
  int  id;
  char name[20];
} myrecord_t;

myrecord_t * alloc_list(__bound__(0, 10000000) unsigned int size)
{
   /* size > 178956970 on 32-bit ===> overflow */
   return malloc(size * sizeof(myrecord_t));
}

void safecaller(__bound__(1, 100000) unsigned int size)
{
  /* Okay - [1-1000000] with-in [0, 10000000] bounds */
  myrecord_t * list = alloc_list(size);

  /* ... */
}

void badcaller(unsigned int size)
{
  /* Compile ERROR - default (32-bit) unsigned int not with-in [0, 10000000] bounds */
  myrecord_t * list = alloc_list(size);

  /* ... */
}

GeneralCCC 01-02-2023 Pin
pkfox31-Jan-23 22:08
professionalpkfox31-Jan-23 22:08 
GeneralRe: CCC 01-02-2023 Pin
FreedMalloc31-Jan-23 22:48
FreedMalloc31-Jan-23 22:48 
GeneralRe: CCC 01-02-2023 - winner ! Pin
pkfox31-Jan-23 23:02
professionalpkfox31-Jan-23 23:02 
GeneralRe: CCC 01-02-2023 - winner ! Pin
OriginalGriff31-Jan-23 23:08
mveOriginalGriff31-Jan-23 23:08 
GeneralRe: CCC 01-02-2023 - winner ! Pin
pkfox31-Jan-23 23:41
professionalpkfox31-Jan-23 23:41 
GeneralRe: CCC 01-02-2023 - winner ! Pin
FreedMalloc1-Feb-23 2:46
FreedMalloc1-Feb-23 2:46 
GeneralWordle 592 Pin
StarNamer@work31-Jan-23 13:51
professionalStarNamer@work31-Jan-23 13:51 
GeneralRe: Wordle 592 Pin
Sandeep Mewara31-Jan-23 15:24
mveSandeep Mewara31-Jan-23 15:24 
GeneralRe: Wordle 592 Pin
Amarnath S31-Jan-23 16:07
professionalAmarnath S31-Jan-23 16:07 
GeneralRe: Wordle 592 Pin
Shane010331-Jan-23 17:23
Shane010331-Jan-23 17:23 
GeneralRe: Wordle 592 Pin
OriginalGriff31-Jan-23 19:04
mveOriginalGriff31-Jan-23 19:04 
GeneralRe: Wordle 592 Pin
den2k8831-Jan-23 20:45
professionalden2k8831-Jan-23 20:45 
GeneralRe: Wordle 592 Pin
Sander Rossel31-Jan-23 20:59
professionalSander Rossel31-Jan-23 20:59 
GeneralRe: Wordle 592 Pin
ChandraRam31-Jan-23 21:13
ChandraRam31-Jan-23 21:13 
GeneralRe: Wordle 592 Pin
pkfox31-Jan-23 21:54
professionalpkfox31-Jan-23 21:54 
GeneralRe: Wordle 592 (4/6) Pin
musefan31-Jan-23 23:52
musefan31-Jan-23 23:52 
GeneralRe: Wordle 592 Pin
Cp-Coder1-Feb-23 4:54
Cp-Coder1-Feb-23 4:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.