compiler option Testing $ls unsigned.c $gcc unsigned.c $./a.out The Geek Stuff [-10] $gcc -funsigned-char unsigned.c $./a.out The Geek Stuff [246] $cat unsigned.c #include<stdio.h> int main(void) { char c = -10; // Print the string printf(“n The Geek Stuff [%d]n”, c); return 0; } $
Category Archives: Uncategorized
GCC COMMANDLINE OPTIONS PART 8 -ansi
commandline session $cat main.c #include<stdio.h> #include<math.h> int main(void) { int i=0; float y; printf(“n The Geek Stuff [%d]n”, i); y=sinf(2.5); printf(“%fn”,y); return 0; } $gcc -ansi main.c /tmp/ccBNR3rx.o: In function `main’: main.c:(.text+0x3c): undefined reference to `sinf’ collect2: error: ld returned 1 exit status $gcc main.c $
GCC COMMANDLINE OPTIONS PART 7
commandline session $gcc -v main.c Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v –with-pkgversion=’Debian 4.7.2-4′ –with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs –enable-languages=c,c++,go,fortran,objc,obj-c++ –prefix=/usr –program-suffix=-4.7 –enable-shared –enable-linker-build-id –with-system-zlib –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –with-gxx-include-dir=/usr/include/c++/4.7 –libdir=/usr/lib –enable-nls –with-sysroot=/ –enable-clocale=gnu –enable-libstdcxx-debug –enable-libstdcxx-time=yes –enable-gnu-unique-object –enable-plugin –enable-objc-gc –with-arch-32=i586 –with-tune=generic –enable-checking=release –build=x86_64-linux-gnu –host=x86_64-linux-gnu –target=x86_64-linux-gnu Thread model: posix gcc version 4.7.2 (Debian 4.7.2-4) COLLECT_GCC_OPTIONS=’-v’ ‘-mtune=generic’ ‘-march=x86-64’ …
GCC COMMANDLINE OPTIONS PART 6
commandline session $ gcc -c -Wall -Werror -fPIC main.c main.c: In function ‘main’: main.c:8:10: error: ‘i’ is used uninitialized in this function [-Werror=uninitialized] cc1: all warnings being treated as errors $vim main.c $cat main.c #include<stdio.h> #include<math.h> int main(void) { float y; printf(“n The Geek Stuff [%d]n”, i); y=sinf(2.5); printf(“%fn”,y); return 0; } $ gcc -c …
GCC COMMANDLINE OPTIONS PART 5
commandline session $cat main.c #include<stdio.h> #include<math.h> int main(void) { int i; float y; printf(“n The Geek Stuff [%d]n”, i); y=sinf(2.5); printf(“%fn”,y); return 0; } $gcc main.c $./a.out The Geek Stuff [0] 0.598472 $gcc main.c -lmath /usr/bin/ld: cannot find -lmath collect2: error: ld returned 1 exit status $gcc main.c -llibmath /usr/bin/ld: cannot find -llibmath collect2: error: …
lspci -vmm . Dump PCI device data in a machine readable form for easy parsing by scripts
commandline session $lspci -vmm Slot: 00:00.0 Class: RAM memory Vendor: NVIDIA Corporation Device: MCP61 Memory Controller SVendor: Giga-byte Technology SDevice: Device 5001 Rev: a1 Slot: 00:01.0 Class: ISA bridge Vendor: NVIDIA Corporation Device: MCP61 LPC Bridge SVendor: Giga-byte Technology SDevice: Device 0c11 Rev: a2 Slot: 00:01.1 Class: SMBus Vendor: NVIDIA Corporation Device: MCP61 SMBus SVendor: …
GCC COMMANDLINE OPTIONS PART 2
commandline session $gcc -S main.c > main.s $cat main.s .file “main.c” .section .rodata .LC0: .string “n The Geek Stuff [%d]n” .text .globl main .type main, @function main: .LFB0: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 subq $16, %rsp movl -4(%rbp), %eax movl %eax, %esi movl $.LC0, %edi movl $0, …
GCC COMMANDLINE OPTIONS PART 1
commandline session $cat main.c #include<stdio.h> int main(void) { printf(“n The Geek Stuffn”); return 0; } $gcc main.c $./a.out The Geek Stuff $gcc main.c -o main $./main The Geek Stuff $gcc -Wall main.c -o main $./main The Geek Stuff $cat main.c #include<stdio.h> int main(void) { int i; printf(“n The Geek Stuff [%d]n”, i); return 0; } …
FREE COMMAND WITH DIFFERENT UNITS
commandline session $free -b total used free shared buffers cached Mem: 2043490304 1840762880 202727424 0 37040128 823631872 -/+ buffers/cache: 980090880 1063399424 Swap: 5984219136 15114240 5969104896 $free -k total used free shared buffers cached Mem: 1995596 1795388 200208 0 36196 804388 -/+ buffers/cache: 954804 1040792 Swap: 5843964 14760 5829204 $free -m total used free shared buffers …
DEBIAN xrandr The X Resize, Rotate and Reflect Extension (RandR)
$xrandr | grep connected VGA-0 connected 1024×768+0+0 (normal left inverted right x axis y axis) 340mm x 270mm $xrandr –output VGA-0 –brightness 1 $xrandr –output VGA-0 –brightness 0.5 $ Theory Drop The X Resize, Rotate and Reflect Extension (RandR)[2] is an X Window System extension, which allows clients to dynamically change X screens, so as …
Continue reading “DEBIAN xrandr The X Resize, Rotate and Reflect Extension (RandR)”