gcc -Wall ഓപ്ഷൻ ഫ്ലാഗ്

gcc -Wall കംപൈലറിന്റെ എല്ലാ മുന്നറിയിപ്പ് സന്ദേശങ്ങളും പ്രവർത്തനക്ഷമമാക്കുന്നു.മികച്ച കോഡ് സൃഷ്ടിക്കുന്നതിന് ഈ ഓപ്ഷൻ എപ്പോഴും ഉപയോഗിക്കേണ്ടതാണ്.

വാക്യഘടന

$ gcc -Wall [options] [source files] [object files] [-o output file]

ഉദാഹരണം

myfile.c എന്ന സോഴ്സ് ഫയൽ എഴുതുക:

// myfile.c
#include <stdio.h>

int main()
{
    printf("Program run!\n");
    int i=10;
}

 

myfile.c യുടെ പതിവ് ബിൽഡ്സന്ദേശങ്ങളൊന്നും നൽകുന്നില്ല:

$ gcc myfile.c -o myfile
$

 

-Wall ഉപയോഗിച്ച് myfile.c നിർമ്മിക്കുക:

$ gcc -Wall myfile.c -o myfile
myfile.c In function 'main':
myfile.c:6:6: warning: unused variable 'i'
myfile.c:7:1: warning: control reaches end of non-void function
$

 

 

 


ഇതും കാണുക

Advertising

ജി.സി.സി
°• CmtoInchesConvert.com •°